This is the mail archive of the mauve-discuss@sourceware.cygnus.com mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: significance of double test?


> 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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]