Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Bit manipulation for Big_int #4641
Original bug ID: 4641
The Big_int module in the Num library would benefit greatly from two simple additions: functions which can shift numbers left and right a given number of bits (the equivalent of asl, lsl, asr, lsr for the type int). Please consider adding them. I am willing to write a patch if someone tells me they will consider it.
I am implementing real number computation in Ocaml, for which I am using the MPFR library. Since MPFR is hard to compile and link with Ocaml (requires a bunch of other tools and libraries), I have decided to reimplement dyadic rationals in "pure" Ocaml. To my shock I discovered that the Big_int package doesn't have the bit shifting operations. So now I have to divide by powers of two, which is really inefficient.