[ 
https://issues.apache.org/jira/browse/SPARK-2479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

DB Tsai updated SPARK-2479:
---------------------------

    Description: 
Due to rounding errors, most floating-point numbers end up being slightly 
imprecise. As long as this imprecision stays small, it can usually be ignored. 
Otherwise, different machine may have different rounding errors which will 
cause some of false negative tests.

See the following article for detail.
http://floating-point-gui.de/errors/comparison/
For example:
        float a = 0.15 + 0.15
        float b = 0.1 + 0.2
        if(a == b) // can be false!
        if(a >= b) // can also be false!


  was:Due to rounding errors, most floating-point numbers end up being slightly 
imprecise. As long as this imprecision stays small, it can usually be ignored. 
Otherwise, different machine may have different rounding errors which will 
cause some of false negative tests.


> Comparing floating-point numbers using relative error in UnitTests
> ------------------------------------------------------------------
>
>                 Key: SPARK-2479
>                 URL: https://issues.apache.org/jira/browse/SPARK-2479
>             Project: Spark
>          Issue Type: Improvement
>            Reporter: DB Tsai
>
> Due to rounding errors, most floating-point numbers end up being slightly 
> imprecise. As long as this imprecision stays small, it can usually be 
> ignored. Otherwise, different machine may have different rounding errors 
> which will cause some of false negative tests.
> See the following article for detail.
> http://floating-point-gui.de/errors/comparison/
> For example:
>       float a = 0.15 + 0.15
>       float b = 0.1 + 0.2
>       if(a == b) // can be false!
>       if(a >= b) // can also be false!



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to