Skip to content

Instantly share code, notes, and snippets.

@rbuckland
Created February 25, 2015 23:21
Show Gist options
  • Save rbuckland/2bb9ae991760ac44c14b to your computer and use it in GitHub Desktop.
Save rbuckland/2bb9ae991760ac44c14b to your computer and use it in GitHub Desktop.
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