Patashu / break_eternity.js

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

Decimal.toString("(e^N)X") returns NaN as the sign. #31

Closed James103 closed 5 years ago

James103 commented 5 years ago

Expected result:

new Decimal("(e^123)456").sign
1
new Decimal("-(e^123)456").sign
-1
new Decimal("(e^123)456").toString()
"(e^123)456"
new Decimal("-(e^123)456").toString()
"-(e^123)456"

Actual result:

new Decimal("(e^123)456").sign
NaN
new Decimal("-(e^123)456").sign
NaN
new Decimal("(e^123)456").toString()
"(e^123)456"
new Decimal("-(e^123)456").toString()
"(e^123)456"