You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comparing ints by subtracting them does not work - the result may overflow. For example: 2000000000 > -2000000000 is true, but 2000000000 - -2000000000 is negative.
Example:
objectTest {
objectMyEnumextendsEnumeration {
valFoo=Value(2000000000)
valBar=Value(-2000000000)
}
importMyEnum._defmain(args: Array[String]) {
println("Should be true, but is: "+ (Foo>Bar))
}
}
from Enumeration.Value, also in nightly:
Comparing ints by subtracting them does not work - the result may overflow. For example: 2000000000 > -2000000000 is true, but 2000000000 - -2000000000 is negative.
Example:
See e.g. http://stackoverflow.com/questions/2728793/java-integer-what-is-faster-comparison-or-subtraction
The text was updated successfully, but these errors were encountered: