Bug in Float.valueOf(String)

Archie Cobbs archie at whistle.com
Mon Jan 25 12:28:34 PST 1999


Maxim Kizub writes:
> Please, change in kaffe/clib/native/Float.c,
> in method java_lang_Float_valueOf:
> 
> /*
>  * Convert string to float object. (JDK 1.0.2)
>  */
> struct Hjava_lang_Float*
> java_lang_Float_valueOf(struct Hjava_lang_String* str)
> {
>         struct Hjava_lang_Float* obj;
> /* Floats are passed as doubles in C!!!!!
>         obj = (struct
> Hjava_lang_Float*)execute_java_constructor("java.lang.Float", 0, "(F)V",
> (float)java_lang_Double_valueOf0(str));
> */      
>         obj = (struct
> Hjava_lang_Float*)execute_java_constructor("java.lang.Float", 0, "(D)V",
> java_lang_Double_valueOf0(str));
>         return (obj);
> }

I don't understand.. what's the problem? Are you just complaining about
the loss of precision, or something worse?

Can you write a quick Java program that demonstrates the problem?

Thanks,
-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


More information about the kaffe mailing list