Half.Round(Int16) Method

Definition

Returns the closest integral half-precision float value to the specified half-precision float value.

[Android.Runtime.Register("round", "(S)S", "", ApiSince=26)]
public static short Round (short h);
[<Android.Runtime.Register("round", "(S)S", "", ApiSince=26)>]
static member Round : int16 -> int16

Parameters

h
Int16

A half-precision float value

Returns

The value of the specified half-precision float rounded to the nearest half-precision float value

Attributes

Remarks

Returns the closest integral half-precision float value to the specified half-precision float value. Special values are handled in the following ways: <ul> <li>If the specified half-precision float is NaN, the result is NaN</li> <li>If the specified half-precision float is infinity (negative or positive), the result is infinity (with the same sign)</li> <li>If the specified half-precision float is zero (negative or positive), the result is zero (with the same sign)</li> </ul>

<p class=note> <strong>Note:</strong> Unlike the identically named int java.lang.Math.round(float) method, this returns a Half value stored in a short, <strong>not</strong> an actual short integer result.

Java documentation for android.util.Half.round(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