Closed wangjiejacques closed 5 years ago
Okay. But since you already know the reason, what would you like me to do about it?
Depending on your use case, you could possibly work around this by printing the result with fewer significant figures?
If you really need it to be precise, the only option I can think of is to use AnyExpression
with NSDecimalNumber
(or some BigNum library) values, but then you'd have to implement all the math operators and functions yourself as custom operators.
the result of 7+6.3+5.3+4.42 is 23.02, but what it returns is 23.020000000000003, I know it's because
Double
is not accurate enough for this result.