A Javascript numerical library to represent numbers as large as 10^^1e308 and as small as 10^-10^^1e308. Sequel to break_infinity.js, designed for incremental games.
MIT License
122
stars
46
forks
source link
ssqrt returns 1 for too large numbers (layer ~ Number.MAX_SAFE_INTEGER). #30
new Decimal.fromComponents(1,1000000000000000,10).ssqrt().toString()
"(e^999999999999998)10000000000"
new Decimal.fromComponents(1,10000000000000000,10).ssqrt().toString()
"(e^9999999999999998)10000000000"
Actual result:
new Decimal.fromComponents(1,1000000000000000,10).ssqrt().toString()
"(e^999999999999998)10000000000"
new Decimal.fromComponents(1,10000000000000000,10).ssqrt().toString()
"1"
Exact problem threshold point occurs when layer is around Number.MAX_SAFE_INTEGER.
Expected result:
Actual result:
Exact problem threshold point occurs when layer is around
Number.MAX_SAFE_INTEGER
.