Share via


Float.IntBitsToFloat(Int32) Method

Definition

Returns the float value corresponding to a given bit representation.

[Android.Runtime.Register("intBitsToFloat", "(I)F", "")]
public static float IntBitsToFloat(int bits);
[<Android.Runtime.Register("intBitsToFloat", "(I)F", "")>]
static member IntBitsToFloat : int -> single

Parameters

bits
Int32

an integer.

Returns

the float floating-point value with the same bit pattern.

Attributes

Remarks

Returns the 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.

If the argument is 0x7f800000, the result is positive infinity.

If the argument is 0xff800000, the result is negative infinity.

If the argument is any value in the range 0x7f800001 through 0x7fffffff or in the range 0xff800001 through 0xffffffff, the result is a NaN. No IEEE 754 floating-point operation provided by Java can distinguish between two NaN values of the same type with different bit patterns. Distinct values of NaN are only distinguishable by use of the Float.floatToRawIntBits method.

In all other cases, let s, e, and m be three values that can be computed from the argument:

{

Java documentation for java.lang.Float.intBitsToFloat(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to