Issue Details (XML | Word | Printable)

Key: MATH-264
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Luc Maisonobe
Reporter: Gilles
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Math

New "equals" method in "MathUtils"

Created: 29/Apr/09 11:25 AM   Updated: 07/Aug/09 09:13 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 29/Apr/09 06:35 PM


 Description  « Hide
Hello.

The article

http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm

proposes a robust way of comparing floating-point numbers (look for "AlmostEqual2sComplement").
It provides an implementation (in C) for type "float", which should be adapted to take 2 "double"s instead.

Gilles



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #769867 Wed Apr 29 18:33:59 UTC 2009 luc Added an utility equality method between double numbers using tolerance
in ulps (Units in Last Position)
JIRA: MATH-264
Files Changed
MODIFY /commons/proper/math/trunk/src/java/org/apache/commons/math/util/MathUtils.java
MODIFY /commons/proper/math/trunk/src/site/xdoc/changes.xml
MODIFY /commons/proper/math/trunk/src/test/org/apache/commons/math/util/MathUtilsTest.java