RosettaCodeData/Task/Integer-overflow/Standard-ML/integer-overflow.ml

11 lines
345 B
OCaml

~(~9223372036854775807-1) ;
poly: : error: Overflow exception raised while converting ~9223372036854775807 to int
Int.maxInt ;
val it = SOME 4611686018427387903: int option
~(~4611686018427387903 - 1);
Exception- Overflow raised
(~4611686018427387903 - 1) div ~1;
Exception- Overflow raised
2147483648 * 2147483648 ;
Exception- Overflow raised