Float

Constructors

this
this(float value)

Constructs a newly allocated {@code Float} object that represents the primitive {@code float} argument.

this
this(double value)

Constructs a newly allocated {@code Float} object that represents the argument converted to type {@code float}.

this
this(string s)

Constructs a newly allocated {@code Float} object that represents the floating-point value of type {@code float} represented by the string. The string is converted to a {@code float} value as if by the {@code valueOf} method.

Members

Functions

isInfinite
bool isInfinite()

Returns {@code true} if this {@code Float} value is infinitely large in magnitude, {@code false} otherwise.

isNaN
bool isNaN()

Returns {@code true} if this {@code Float} value is a Not-a-Number (NaN), {@code false} otherwise.

toHash
size_t toHash()

Returns a hash code for a {@code double} value; compatible with {@code Double.hashCode()}.

Static functions

floatToRawIntBits
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.

intBitsToFloat
float intBitsToFloat(int bits)

Returns the {@code float} value corresponding to a given bit representation. The argument is considered to be a representation of a floating-point value according to the IEEE 754 floating-point "single format" bit layout.

isFinite
bool isFinite(float f)

Returns {@code true} if the argument is a finite floating-point value; returns {@code false} otherwise (for NaN and infinity arguments).

isInfinite
bool isInfinite(float v)

Returns {@code true} if the specified number is infinitely large in magnitude, {@code false} otherwise.

isNaN
bool isNaN(float v)

Returns {@code true} if the specified number is a Not-a-Number (NaN) value, {@code false} otherwise.

parseFloat
float parseFloat(string s)
Undocumented in source. Be warned that the author may not have intended to support it.
valueOf
Float valueOf(float f)

Returns a {@code Float} instance representing the specified {@code float} value. If a new {@code Float} instance is not required, this method should generally be used in preference to the constructor {@link #Float(float)}, as this method is likely to yield significantly better space and time performance by caching frequently requested values.

Variables

BYTES
enum int BYTES;

The number of bytes used to represent a {@code float} value.

MAX_EXPONENT
enum int MAX_EXPONENT;

Maximum exponent a finite {@code float} variable may have. It is equal to the value returned by {@code Math.getExponent(Float.MAX_VALUE)}.

MAX_VALUE
enum float MAX_VALUE;

A constant holding the largest positive finite value of type {@code float}, (2-2<sup>-23</sup>)&middot;2<sup>127</sup>. It is equal to the hexadecimal floating-point literal {@code 0x1.fffffeP+127f} and also equal to {@code Float.intBitsToFloat(0x7f7fffff)}.

MIN_EXPONENT
enum int MIN_EXPONENT;

Minimum exponent a normalized {@code float} variable may have. It is equal to the value returned by {@code Math.getExponent(Float.MIN_NORMAL)}.

MIN_NORMAL
enum float MIN_NORMAL;

A constant holding the smallest positive normal value of type {@code float}, 2<sup>-126</sup>. It is equal to the hexadecimal floating-point literal {@code 0x1.0p-126f} and also equal to {@code Float.intBitsToFloat(0x00800000)}.

MIN_VALUE
enum float MIN_VALUE;

A constant holding the smallest positive nonzero value of type {@code float}, 2<sup>-149</sup>. It is equal to the hexadecimal floating-point literal {@code 0x0.000002P-126f} and also equal to {@code Float.intBitsToFloat(0x1)}.

NEGATIVE_INFINITY
enum float NEGATIVE_INFINITY;

A constant holding the negative infinity of type {@code float}. It is equal to the value returned by {@code Float.intBitsToFloat(0xff800000)}.

NaN
enum float NaN;

A constant holding a Not-a-Number (NaN) value of type {@code float}. It is equivalent to the value returned by {@code Float.intBitsToFloat(0x7fc00000)}.

POSITIVE_INFINITY
enum float POSITIVE_INFINITY;

A constant holding the positive infinity of type {@code float}. It is equal to the value returned by {@code Float.intBitsToFloat(0x7f800000)}.

SIZE
enum int SIZE;

The number of bits used to represent a {@code float} value.

Meta