diff options
Diffstat (limited to 'libjava/java/lang/Float.java')
-rw-r--r-- | libjava/java/lang/Float.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libjava/java/lang/Float.java b/libjava/java/lang/Float.java index b2c84c7..7677ca4 100644 --- a/libjava/java/lang/Float.java +++ b/libjava/java/lang/Float.java @@ -1,5 +1,5 @@ /* Float.java -- object wrapper for float - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -94,6 +94,12 @@ public final class Float extends Number implements Comparable public static final Class TYPE = VMClassLoader.getPrimitiveClass('F'); /** + * The number of bits needed to represent a <code>float</code>. + * @since 1.5 + */ + public static final int SIZE = 32; + + /** * The immutable value of this Float. * * @serial the wrapped float @@ -192,6 +198,22 @@ public final class Float extends Number implements Comparable } /** + * Returns a <code>Float</code> object wrapping the value. + * In contrast to the <code>Float</code> constructor, this method + * may cache some values. It is used by boxing conversion. + * + * @param val the value to wrap + * @return the <code>Float</code> + * + * @since 1.5 + */ + public static Float valueOf(float val) + { + // We don't actually cache, but we could. + return new Float(val); + } + + /** * Parse the specified <code>String</code> as a <code>float</code>. The * extended BNF grammar is as follows:<br> * <pre> |