What is the length of int in OCaml? It is said that int in OCaml is 31. But I get this:
# (1 lsl 33);; - : int = 8589934592
8589934592 is larger than 2^31.
let rec count1s x = match (x lsr 1, x land 1) with | 0, n -> n | y, n -> n + count1s y count1s (-1);;
Answered by anonymous.