From 8f523f3a1047919d3563daf1ef47ba87336ebe89 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 15 Nov 2005 23:20:01 +0000 Subject: Imported GNU Classpath 0.19 + gcj-import-20051115. * sources.am: Regenerated. * Makefile.in: Likewise. * scripts/makemake.tcl: Use glob -nocomplain. From-SVN: r107049 --- libjava/classpath/java/lang/Float.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libjava/classpath/java/lang/Float.java') diff --git a/libjava/classpath/java/lang/Float.java b/libjava/classpath/java/lang/Float.java index e6200dabddc..eef34a0abeb 100644 --- a/libjava/classpath/java/lang/Float.java +++ b/libjava/classpath/java/lang/Float.java @@ -93,6 +93,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 float. + * @since 1.5 + */ + public static final int SIZE = 32; + /** * The immutable value of this Float. * @@ -191,6 +197,22 @@ public final class Float extends Number implements Comparable return new Float(parseFloat(s)); } + /** + * Returns a Float object wrapping the value. + * In contrast to the Float constructor, this method + * may cache some values. It is used by boxing conversion. + * + * @param val the value to wrap + * @return the Float + * + * @since 1.5 + */ + public static Float valueOf(float val) + { + // We don't actually cache, but we could. + return new Float(val); + } + /** * Parse the specified String as a float. The * extended BNF grammar is as follows:
-- cgit v1.2.3