Closed GoogleCodeExporter closed 9 years ago
Fixed in 2.1 but the right method is pow(int) ....
Original comment by marco.ge...@gmail.com
on 6 Aug 2009 at 9:50
Marco, from what I can tell this is actually not fixed in the 2.1 release.
BigDecimal
is a port from the Java class of the same name. However the power function
depends
upon an integer overflow which will not occur in javascript:
2405 n=n+n; // shift left 1 bit
2406 if (n<0)
I got in touch with the original author, he provided the fix below:
2405 n<<=1; // shift left 1 bit
2406 if (n<0)
Hope this helps,
Matt
Original comment by mbaker....@gmail.com
on 15 Oct 2009 at 10:28
Original issue reported on code.google.com by
twekst...@gmail.com
on 22 Mar 2009 at 6:27