https://issues.apache.org/bugzilla/show_bug.cgi?id=43940

--- Comment #40 from Glenn Adams <gad...@apache.org> ---
(In reply to comment #39)
> (In reply to comment #38)
> > (In reply to comment #36)
> > > The bug is trivial:
> > > "if (source >= 10e-3 && source < 1e7) {" is wrong !
> > > "if (source >= 1e-3 && source < 1e7) {" is right.
> > > 
> > > My mistake when reading 10 exp -3 in Double.toString javadoc and writing
> > > 10e-3 instead of 1e-3.
> > > 
> > > Patch will follow.
> > 
> > i'm not satisfied with this patch, since it depends upon the implementation
> > specific nature of Double.toString(); i would like to see better checking in
> > the code I listed in comment 34 to remove assumptions about the use of
> > scientific notation (and assuming that 'E' is present)
> 
> for example, what happens if source is NaN? just looking at the code makes
> me think the same else clause cited in comment 34 will apply, which means
> yet again, that parseInt will be invoked on the string "NaN"

in this regard, please add NaN, +Infinity, and -Infinity to  your test cases; 
also add the following test cases:

* 1E-3 + Double.MIN_VALUE
* 1E-3
* 1E-3 - Double.MIN_VALUE
* 1E7  + Double.MIN_VALUE
* 1E7
* 1E7  - Double.MIN_VALUE

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to