Created
February 25, 2015 23:21
-
-
Save rbuckland/2bb9ae991760ac44c14b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> val x:Double = Long.MaxValue // x: Double = 9.223372036854776E18 (9223372036854775807) | |
scala> x == Long.MaxValue // Boolean = true | |
scala> x.longValue == Long.MaxValue // Boolean = true | |
scala> val y = 1234567890123456789L // y: Long = 1234567890123456789 // less than Long.MaxValue | |
scala> y < x // Boolean = true | |
scala> val z:Double = y // z: Double = 1.23456789012345677E18 | |
scala> z == y // Boolean = true | |
scala> z.longValue == y // Boolean = false // why ? MaxValue fits in the Double |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment