MikeMcl / decimal.js

An arbitrary-precision Decimal type for JavaScript
http://mikemcl.github.io/decimal.js
MIT License
6.35k stars 480 forks source link

decimal result is NaN of string #185

Closed zhongmeizhi closed 2 years ago

zhongmeizhi commented 2 years ago

decimal result is NaN of string

example:

   new Decimal('0.00').div('0.00').toPrecision(2)  === 'NaN'
MikeMcl commented 2 years ago

I don't understand you. What is the issue here?

The type of the return value of toPrecision will always be "string".

Number.isNaN(0 / 0);     // true
zhongmeizhi commented 2 years ago

I see;