Can someone explain, what is going on
> let y = 65536 * 65536 ;;
val y : int = 0
> let y = 655361 * 655361 ;;
val y : int = 1310721
> let y = 65536 * 65536 ;;
val y : int = 0
> let y = 655361 * 65536 ;;
val y : int = 65536
> let y = 655362 * 65536 ;;
val y : int = 131072
> let y = 2 * 65536 ;;
val y : int = 131072
I checked the docs and an int should support values from -2,147,483,648 to 2,147,483,647.
I am running version 4.1 on linux
more weirdness
> 65537 * 65536;;
val it : int = 65536
> 65539 * 65536;;
val it : int = 196608