Created
June 6, 2016 15:02
-
-
Save alecgrieser/ab285f4ee6b445ec66f38dcbb91f0568 to your computer and use it in GitHub Desktop.
Math overflow problem in Cool equality
This file contains 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
class Main inherits IO { | |
main() : SELF_TYPE { | |
{ | |
out_eq(2147483647+2147483647, ~2); | |
out_eq(2*2147483647, ~2); | |
} | |
}; | |
out_eq(a : Int, b : Int) : SELF_TYPE { | |
out_int(a).out_string(" = ").out_int(b).out_string(" <==> ") | |
.out_string(if a = b then "true\n" else "false\n" fi) | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment