No. But I can show you the 3 or 4 pages of Scheme code which implements the algorithm. If this is not a top priority then we can ask Olivier to work on that.
Can't you scheme-to-js it all ;)
My guess is that you are trying to divide by 2^12... perhaps you could right shift by 12.
No, I'm actually doing division/modulo of unboxed integers during constant propagation. It's not really practical to do it on boxed integers directly with the current IR.
Also, on machine with 64 bit words, the radix can be 2^30, and that might be big enough to make the divisions doable with a single digit divisor.
One limiting factor is that JS only allows bitwise operations on 32 bit values. Was this one of the factors in your decision to limit the precision of big digits?
Also, if we have only 52 bits available in our boxed integers, can the radix really be 2^30?
- Maxime