This is the mail archive of the
mauve-discuss@sourceware.cygnus.com
mailing list for the Mauve project.
Re: significance of double test?
- To: aph at pasanda dot cygnus dot co dot uk
- Subject: Re: significance of double test?
- From: Peter Naulls <peter at erble dot freeserve dot co dot uk>
- Date: Mon, 13 Mar 2000 18:44:44 +0000
- Cc: mauve-discuss at sourceware dot cygnus dot com
In message <20000313172024.6130.qmail@pasanda.cygnus.co.uk>
Andrew Haley <aph@pasanda.cygnus.co.uk> wrote:
> > 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?
Ah, perhaps you missed some of my post from quoting - my JVM exhibits
the exact undesirsable behaviour in the comment you can see above
before this text - which is really why I made this query.
My JVM uses JDK 1.1.8 libraries, so if the problem's in that, then
there's perhaps not much I can do, OTOH, if it's a C/C library issue,
then I can possibly work around it (and even get the OS developers to
fix it for the future). I'm not sure if I've looked very hard at
the matter - e.g. examining the value from atod(), which is called in
a native method the Double class calls.
Peter
--
+---------------------------------------------+-----------------------------+
| Peter Naulls - pnaulls@usa.net | |
| http://free.prohosting.com/~chocky/ | Java and JVM Consultant |
| Java for RISC OS and ARM - java-arm@usa.net | Technical Author |
| http://free.prohosting.com/~chocky/java/ | Program performance analyst |
+---------------------------------------------+-----------------------------+