BigInt is quite slow in some High-precision operations, such as BigInt.from(1000000000000001).pow(1234567)
#53762
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-math
type-enhancement
A request for a change that isn't a bug
my General info:
As the title metioned, code:
BigInt.from(1000000000000001).pow(1234567);
runs very slowly and won't even stop.
I tested the same case in JAVA using BigDecimal, and it runs slowly too but better than dart do.
BigDecimal.valueOf(1000000000000001).pow(1234567);
Howerver, BigDecimal.pow() has another param called MathContext to set calculation precision, like:
BigDecimal.valueOf(1000000000000001).pow(1234567, MathContext.DECIMAL128);
and then i get the result in an appropriate time.
So my question is should BigInt add a parameter like MathContext?
The text was updated successfully, but these errors were encountered: