Bug 246892 - NumberUtil.isDouble() broken
Summary: NumberUtil.isDouble() broken
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.2.1   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-09-10 13:07 EDT by Achim Demelt CLA
Modified: 2011-05-27 02:47 EDT (History)
0 users

See Also:


Attachments
Patch for NumberUtil.isDouble() (938 bytes, patch)
2008-09-10 13:07 EDT, Achim Demelt CLA
give.a.damus: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Demelt CLA 2008-09-10 13:07:46 EDT
Created attachment 112228 [details]
Patch for NumberUtil.isDouble()

See bug #245897. The current implementation tends to yield false for BigDecimals that actually _can_ be converted to double values. With the potential loss of precision, of course.

Patch is attached. It actually is a subset of the patch from bug #245897. I'd love to provide a testcase, but I couldn't think of a good place to put it. It would have to call NumberUtil.isDouble() directly.
Comment 1 Christian Damus CLA 2008-09-10 15:38:58 EDT
(In reply to comment #0)
> Patch is attached. It actually is a subset of the patch from bug #245897. I'd
> love to provide a testcase, but I couldn't think of a good place to put it. It
> would have to call NumberUtil.isDouble() directly.

I'll let that be my problem, this time.  ;-)
Comment 2 Christian Damus CLA 2008-09-10 15:47:32 EDT
Committed the patch to the 1.2.2 release.
Comment 3 Achim Demelt CLA 2008-09-11 02:13:39 EDT
Christian, thanks a lot!
Comment 4 Ed Willink CLA 2011-05-27 02:47:52 EDT
Closing after over 18 months in resolved state.