tools4j / decimal4j

Java library for fast fixed-point arithmetic based on longs with support for up to 18 decimal places.
decimal4j.org
MIT License
156 stars 17 forks source link

DoubleRounderTest doesn't check expected and actual double values match #10

Closed Overruler closed 8 years ago

Overruler commented 8 years ago

The org.decimal4j.util.DoubleRounderTest class has a bug and can never fail. As a result ArithmeticResult class only asserts if thrown exceptions are different.

The cause of the bug is that the two ArithmeticResult instances that should compare expected and actual values are both created using the original double value rather than the rounded values the test calculates.

terzerm commented 8 years ago

Thanks for reporting --- good finding.

terzerm commented 8 years ago

Fixed with commit 6045df60424c42153475d79044f77f8d8a55e19b.