API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.lang. Float View Source
Author(s)
Lee Boynton
Arthur van Hoff
Joseph D. Darcy
Since
JDK1.0
Version
1.101, 04/07/06
Serial
Hierarchy
 Object
      Number
          Float
Implements
 Comparable
Subclasses
Description
publicfinal class Float
  The Float class wraps a value of primitive type float in an object.
See also:   
Constructors
public Float (double value)
  Constructs a newly allocated Float object that represents the argument converted to type float.
public Float (float value)
  Constructs a newly allocated Float object that represents the primitive float argument.
public Float (String s) throws NumberFormatException
  Constructs a newly allocated Float object that represents the floating-point value of type float represented by the string.
Methods
Hide/Show inherited methods
public byte byteValue () [Overrides Number]
  Returns the value of this Float as a byte (by casting to a byte).
publicstatic int compare (float f1, float f2)
  Compares the two specified float values.
public int compareTo (Float anotherFloat)
  Compares two Float objects numerically.
public double doubleValue () [Specified in Number]
  Returns the double value of this Float object.
public boolean equals (Object obj)
  Compares this object against the specified object.
publicstatic int floatToIntBits (float value)
  Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout.
publicstaticnative int floatToRawIntBits (float value)
  Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout, preserving Not-a-Number (NaN) values.
public float floatValue () [Specified in Number]
  Returns the float value of this Float object.
public int hashCode ()
  Returns a hash code for this Float object.
publicstaticnative float intBitsToFloat (int bits)
  Returns the float value corresponding to a given bit representation.
public int intValue () [Specified in Number]
  Returns the value of this Float as an int (by casting to type int).
public boolean isInfinite ()
  Returns true if this Float value is infinitely large in magnitude, false otherwise.
publicstatic boolean isInfinite (float v)
  Returns true if the specified number is infinitely large in magnitude, false otherwise.
public boolean isNaN ()
  Returns true if this Float value is a Not-a-Number (NaN), false otherwise.
publicstatic boolean isNaN (float v)
  Returns true if the specified number is a Not-a-Number (NaN) value, false otherwise.
public long longValue () [Specified in Number]
  Returns value of this Float as a long (by casting to type long).
publicstatic float parseFloat (String s) throws NumberFormatException
  Returns a new float initialized to the value represented by the specified String, as performed by the valueOf method of class Float.
public short shortValue () [Overrides Number]
  Returns the value of this Float as a short (by casting to a short).
publicstatic String toHexString (float f)
  Returns a hexadecimal string representation of the float argument.
public String toString ()
  Returns a string representation of this Float object.
publicstatic String toString (float f)
  Returns a string representation of the float argument.
publicstatic Float valueOf (float f)
  Returns a Float instance representing the specified float value.
publicstatic Float valueOf (String s) throws NumberFormatException
  Returns a Float object holding the float value represented by the argument string s.
Fields
Hide/Show inherited fields
publicfinalstatic int MAX_EXPONENT = "127"
  Maximum exponent a finite float variable may have.
publicfinalstatic float MAX_VALUE = "3.4028235E38"
  A constant holding the largest positive finite value of type float, (2-2-23)·2127.
publicfinalstatic int MIN_EXPONENT = "-126"
  Minimum exponent a normalized float variable may have.
publicfinalstatic float MIN_NORMAL = "1.17549435E-38"
  A constant holding the smallest positive normal value of type float, 2-126.
publicfinalstatic float MIN_VALUE = "1.4E-45"
  A constant holding the smallest positive nonzero value of type float, 2-149.
publicfinalstatic float NaN = "NaN"
  A constant holding a Not-a-Number (NaN) value of type float.
publicfinalstatic float NEGATIVE_INFINITY = "-Infinity"
  A constant holding the negative infinity of type float.
publicfinalstatic float POSITIVE_INFINITY = "Infinity"
  A constant holding the positive infinity of type float.
publicfinalstatic int SIZE = "32"
  The number of bits used to represent a float value.
publicfinalstatic Class<Float> TYPE
  The Class instance representing the primitive type float.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar