Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#5 1.0-0.9

pending
nobody
None
Bug
None
2013-09-09
2013-09-09
Anonymous
No

When evaluating "1.0-0.1" I get 0.09999999999999998.

Bug?

Discussion

  • Fathzer
    Fathzer
    2013-09-09

    I'm unable to reproduce that behaviour.
    Probably it would be easier with :
    - The javaluator version you use.
    - The source code that produces that ouptut.
    - The java version you use.

    Nevertheless, you should know that double has not an infinite precision and the result seems to me not so strange (http://www.velocityreviews.com/forums/t139008-java-double-precision.html).

    You probably should use a number formatter that rounds the result. The other option is to implement a custom evaluator using BigDecimal.

    Best regards,

    Jean-Marc Astesana

     


Anonymous


Cancel   Add attachments