Menu

#7 BigDecimal instead of double

pending
nobody
FeatureRequest
Rejected
2014-05-27
2013-12-11
Anonymous
No

It would be great if BigDecimal were used instead of double, it would solve the famous 0.1 + 0.2 = 0.300...004 issue.

Currently,
new DoubleEvaluator().evaluate("0.1 + 0.2");
returns
0.30000000000000004

Discussion

  • Fathzer

    Fathzer - 2013-12-12

    Yes, this would solve that issue ... and adds some issues on trigonometric functions (for example). Another way to solve the issue is to round the result.

    Javaluator allows you to implement your own evaluators in a few lines of code, depending on what you exactly need. Examples are provided in the tutorial:
    http://javaluator.soft.fathzer.com/en/doc/tutorial.php?chapter=creatingSimple

     
  • Fathzer

    Fathzer - 2014-05-27
    • status: open --> pending
    • Reply: None --> Rejected
     

Anonymous
Anonymous

Add attachments
Cancel