in ocaml I am trying to write a function which takes as an argument a 32 bit unsigned integer. However I am having problems determining the correct identifier to use in the type declaration of the function. By googling I could only find int32. Thanks
Share
Int32 models signed 32-bit arithmetic. If you’re only planning to pass such values around (for example to communicate them to a C API), or use operations that don’t depend on signedness, such as
add,mul,sub, you can useInt32just fine. Division and modulo are implemented differently on signed and unsigned numbers, so you shouldn’t use those of the Int32 module.(There was a previous caml-list discussion on this topic.)