This is the mail archive of the
mauve-discuss@sources.redhat.com
mailing list for the Mauve project.
Re: Float.toString test
- Subject: Re: Float.toString test
- From: Peter Naulls <peter at erble dot freeserve dot co dot uk>
- Date: Tue, 11 Jul 2000 23:46:07 +0100
- Cc: mauve-discuss at sourceware dot cygnus dot com
In message <BE97ACF1A2EB464886E1DAF6C51BAC6E31E689@DF-SPOT.platinum.corp.microsoft.com>
"Xubin Wu (Volt Computer)" <a-xubinw@Exchange.Microsoft.com> wrote:
> c:\mauve-snapshot-2000-06-17>echo
> gnu.testlet.java.lang.Float.FloatTest|java gnu.testlet.SimpleTestHarness
> gnu.testlet.java.lang.Float.FloatTest
> FAIL: gnu.testlet.java.lang.Float.FloatTest: Error: test_toString failed
> - 10 (number 1)
> 1 of 68 tests failed
>
> when I run FloatTest, one test case fails which is
> str = Float.toString( 0.001f );
> harness.check(!( !Float.toString( 0.001f ).equals
> ("0.001" )),
> "Error: test_toString failed - 10" );
> it returns 0.0010, not 0.001.
> When I passed Float.toString( 0.01f ), it returns 0.01.
> Does anybody think it is a bug, or something else.
It looks like a bug. The 1.1 toString method in java.lang.Float
suggest that values in that range should be in a ddd.ddd style:
I'm not sure about Java 1.2, but I recall in 1.0.2 this was more lax -
and that the behaviour of Sun's 1.0.2 JVM didn't quite match the API.
Peter
--
------------------------------------------------------------------------
Peter Naulls - peter@erble.freeserve.co.uk
Homepage - http://free.prohosting.com/~chocky/
Java for RISC OS and ARM - http://free.prohosting.com/~chocky/java/
Debian Linux on RiscPCs - http://www.erble.freeserve.co.uk/
------------------------------------------------------------------------