You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2002/11/27 08:30:35 UTC
DO NOT REPLY [Bug 14884] New: -
NumberRange inaccurate for Long, etc.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14884>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14884
NumberRange inaccurate for Long, etc.
Summary: NumberRange inaccurate for Long, etc.
Product: Commons
Version: 1.0.1 Final
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: Other
Component: Lang
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: tackline@tackline.demon.co.uk
NumberRange assumes everything is representable by a double. This is not the
case. In particular the classes Long, BigInteger and BigDecimal are standard
parts of J2SE that do not obey to assumption. As an example the following test
fails.
assertFalse(new NumberRange(new Long(Long.MAX_VALUE)).includesNumber(new
Long(Long.MAX_VALUE-1)));
I guess this bug is really a problem with the design of the class. You could
check the exact class and take appropriate action, but that would be long,
complicated and quite possibly pointless. I would suggest that the class is
replaced with one that assumes doubles instead of Number.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>