Closed akita11 closed 6 years ago
BigNumber doesn't have an operator float and it wouldn't make a huge amount of sense for it to do so. The compiler probably selects the nearest operator, being operator long, which would truncate the decimal points. Since big numbers can have hundreds of decimal points, casting to float would discard most of them.
If you must, use atof to convert the string returned by a big number to a float.
Thanks, I've understood the internal operation in the library. Let me close this issue.
Casting float-type variable seems to be ignoring fractional part?
This code results in:
Is this a specification of BigNumber?