commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <>
Subject [math] Rounding implementation in MathUtils
Date Mon, 08 Aug 2005 14:22:17 GMT
Can someone else pls have a look at

This is holding up the 1.1 release.  I like the support for all of the
rounding modes that we get by using BigDecimal and - though I have not
verified this - I would expect the results to be exact over a wider
range of <value, scale> combinations than direct implementation would
give.  On the other hand, we have the string conversion and object
creation overhead.  I haven't done any microbenchmarks, but if someone
else has the time, it might be good to look at direct impl of, say,
ROUND_HALF_UP vs. the current impl.  Opinions please...

I am inclined to close this as FIXED (once more tests have been
added).  Note that this will commit us to supporting all of the
rounding modes, even if we decide to replace the implemenation later. 
 Some of these - e.g. ROUND_NOT_NECESSARY -  may have funny semantics
for some double / float values.   Additional unit tests to document /
demonstrate / validate exactly how all of these modes work will be
needed in any case.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message