dbl -> toDouble
This commit is contained in:
@@ -8,8 +8,8 @@ fun main(args : Array<String>) {
|
||||
// val MILLIS_PER_DAY_ : Long = 24 * 60 * 60 * 1000
|
||||
|
||||
// Solution:
|
||||
val MICROS_PER_DAY : Long = 24.long * 60 * 60 * 1000 * 1000;
|
||||
val MILLIS_PER_DAY : Long = 24.long * 60 * 60 * 1000
|
||||
val MICROS_PER_DAY : Long = 24.toLong() * 60 * 60 * 1000 * 1000;
|
||||
val MILLIS_PER_DAY : Long = 24.toLong() * 60 * 60 * 1000
|
||||
|
||||
println(MICROS_PER_DAY / MILLIS_PER_DAY)
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ namespace long.division.solution
|
||||
import std.io.*
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
val MICROS_PER_DAY : Long = 24.long * 60 * 60 * 1000 * 1000;
|
||||
val MILLIS_PER_DAY : Long = 24.long * 60 * 60 * 1000
|
||||
val MICROS_PER_DAY : Long = 24.toLong() * 60 * 60 * 1000 * 1000;
|
||||
val MILLIS_PER_DAY : Long = 24.toLong() * 60 * 60 * 1000
|
||||
|
||||
println(MICROS_PER_DAY / MILLIS_PER_DAY)
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ fun main(args : Array<String>) {
|
||||
// println(12345 + 5432l)
|
||||
|
||||
// Correct syntax:
|
||||
println(12345 + 5432.long)
|
||||
println(12345 + 5432.toLong())
|
||||
}
|
||||
@@ -3,6 +3,6 @@ namespace multicast
|
||||
import std.io.*
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
println(-1.byte.char.int)
|
||||
println((-1).byte.char.int)
|
||||
println(-1.toByte().toChar().toInt())
|
||||
println((-1).toByte().toChar().toInt())
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@ import std.*
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
// Note: \u000A is Unicode representation of linefeed (LF)
|
||||
val c : Char = 0x000A .char;
|
||||
val c : Char = 0x000A .toChar();
|
||||
println(c);
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@ import std.io.*
|
||||
fun main(args : Array<String>) {
|
||||
// for (b : Byte in Byte.MIN_VALUE..Byte.MAX_VALUE) {
|
||||
// // Problematic code does not compile
|
||||
// if (b == 0x90 .byte)
|
||||
// if (b == 0x90 .toByte())
|
||||
// println("joy")
|
||||
// }
|
||||
for (b : Byte in Byte.MIN_VALUE to Byte.MAX_VALUE) {
|
||||
// Problematic code does not compile
|
||||
if (b == 0x90 .byte)
|
||||
if (b == 0x90 .toByte())
|
||||
println("joy")
|
||||
}
|
||||
}
|
||||
@@ -40,4 +40,4 @@ class NumberRange<T : Comparable<T>>(val from : Int, val to : Int) : Range<Int>,
|
||||
}
|
||||
}
|
||||
|
||||
fun Byte.to(to : Byte) = NumberRange<Byte>(this.int, to.int)
|
||||
fun Byte.to(to : Byte) = NumberRange<Byte>(this.toInt(), to.toInt())
|
||||
@@ -3,8 +3,8 @@ namespace ghost.of.looper
|
||||
import std.io.*
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
var i : Short = -1.short
|
||||
while (i != 1.short)
|
||||
var i : Short = -1.toShort()
|
||||
while (i != 1.toShort())
|
||||
// Lots of magic made explicit:
|
||||
i = (i.int ushr 1).short
|
||||
i = (i.toInt() ushr 1).toShort()
|
||||
}
|
||||
Reference in New Issue
Block a user