This is the mail archive of the
mauve-discuss@sourceware.cygnus.com
mailing list for the Mauve project.
Re: significance of double test?
- To: peter at erble dot freeserve dot co dot uk, mauve-discuss at sourceware dot cygnus dot com
- Subject: Re: significance of double test?
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 13 Mar 2000 17:20:24 -0000
> Date: Mon, 13 Mar 2000 09:09:14 -0800 (PST)
> From: Tom Tromey <tromey@cygnus.com>
>
> >>>>> "Peter" == Peter Naulls <peter@erble.freeserve.co.uk> writes:
>
> Peter> This is the first test from new_Double:
>
> Peter> // Some broken implementations convert "7.79625120912E289" to
> Peter> // the value 7.796251209119999E289.
> Peter> harness.check (new Double("7.79625120912E289").toString (),
> Peter> "7.79625120912E289");
>
> Peter> Can someone tell me the significance of this test? i.e., what's
> Peter> the precise behaviour that's likely to result in the wrong value?
>
> I don't know, but I think Andrew probably does. I CC'd him since I
> don't know if he is on mauve-discuss.
It's a test to ensure that the number conversion routines do exact
IEEE rounding. This is really difficult to get right, and I
discovered several problems of this kind in a well-known
manufacturer's JVM.
.79625120912E289 ~= 2^963
What result does your JVM give?
Andrew.