Closed tirrorex closed 5 years ago
Yep. Floating point numbers can’t always give accurate representations of decimal values like this.
I ended up rounding the value after evaluating for anyone interested :)
Actually i could use some help on this. Rounding the value at 11digits does not fix the issue and using a bigger number for rounding result in wrong behaviour for a lot of cases related to doubles. Thoughts ?
Might be related to #99
Evaluating :
let value = String("2.4+1.2") let evaluationValue = try value.evaluate() print(evaluationValue)
gives an ouput of 3.5999999999999 instead of 3.6 @davedelong is this the same issue ?