You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importBigNumberfrom"bignumber.js";constnumber=newBigNumber('1 Definitely 2 not 3 a 4 number 5').exponentiatedBy(newBigNumber('0'));console.log(number.toString());// Prints 1 (not NaN).console.log(number.toFixed());// Prints 1 (not NaN).
I'm not sure whether this behavior is intentional or not, but it seems to me that any arithmetical operation including not-a-number must return not-a-number. Getting "1" creates false impression that operation is valid and was performed using valid operands, which, in my opinion, is not the case with not-a-numbers.
The text was updated successfully, but these errors were encountered:
Hmm, I see. I wasn't aware of this Math's behavior, thanks. I don't think it's correct either, but I guess it's not the place from where we could change it. :)
Repro steps:
I'm not sure whether this behavior is intentional or not, but it seems to me that any arithmetical operation including not-a-number must return not-a-number. Getting "1" creates false impression that operation is valid and was performed using valid operands, which, in my opinion, is not the case with not-a-numbers.
The text was updated successfully, but these errors were encountered: