Half.ToFloat(Int16) Method

Definition

Converts the specified half-precision float value into a single-precision float value.

[Android.Runtime.Register("toFloat", "(S)F", "", ApiSince=26)]
public static float ToFloat (short h);
[<Android.Runtime.Register("toFloat", "(S)F", "", ApiSince=26)>]
static member ToFloat : int16 -> single

Parameters

h
Int16

The half-precision float value to convert to single-precision

Returns

A normalized single-precision float value

Attributes

Remarks

Converts the specified half-precision float value into a single-precision float value. The following special cases are handled:

<ul> <li>If the input is #NaN, the returned value is Float#NaN</li> <li>If the input is #POSITIVE_INFINITY or #NEGATIVE_INFINITY, the returned value is respectively Float#POSITIVE_INFINITY or Float#NEGATIVE_INFINITY</li> <li>If the input is 0 (positive or negative), the returned value is +/-0.0f</li> <li>Otherwise, the returned value is a normalized single-precision float value</li> </ul>

Java documentation for android.util.Half.toFloat(short).

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