* java/lang/Float.java (parseFloat): New method.
From-SVN: r39555
This commit is contained in:
parent
34ce3d7ba5
commit
1c8b24ad46
@ -1,3 +1,7 @@
|
|||||||
|
2001-02-08 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* java/lang/Float.java (parseFloat): New method.
|
||||||
|
|
||||||
2001-02-08 Tom Tromey <tromey@redhat.com>
|
2001-02-08 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
From paul@dawa.demon.co.uk. Fix for PR libgcj/1913:
|
From paul@dawa.demon.co.uk. Fix for PR libgcj/1913:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
|
/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
|
||||||
|
|
||||||
This file is part of libgcj.
|
This file is part of libgcj.
|
||||||
|
|
||||||
@ -49,6 +49,14 @@ public final class Float extends Number implements Comparable
|
|||||||
this.value = valueOf (s).floatValue ();
|
this.value = valueOf (s).floatValue ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float parseFloat (String s) throws NumberFormatException
|
||||||
|
{
|
||||||
|
// The spec says that parseFloat() should work like
|
||||||
|
// Double.valueOf(). This is equivalent, in our implementation,
|
||||||
|
// but more efficient.
|
||||||
|
return (float) Double.parseDouble (s);
|
||||||
|
}
|
||||||
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return toString (value);
|
return toString (value);
|
||||||
|
Loading…
Reference in New Issue
Block a user