Alex Rivera | Logout

Why is an int in OCaml only 31 bits?

Asked 2010-09-22T22:07:39.667
124

Haven't seen this "feature" anywhere else. I know that the 32nd bit is used for garbage collection. But why is it that way only for ints and not for the other basic types?

Edit
Report

1 Answer

17

It's not exactly "used for garbage collection." It's used for internally distinguishing between a pointer and an unboxed integer.

answered 2010-09-22T22:27:25.720

Your Answer