語言

Float.FloatToFloat16(Single) 方法

定義

{

[Android.Runtime.Register("floatToFloat16", "(F)S", "", ApiSince=36)]
public static short FloatToFloat16(float f);
[<Android.Runtime.Register("floatToFloat16", "(F)S", "", ApiSince=36)>]
static member FloatToFloat16 : single -> int16

參數

f
Single

float轉換為 binary16 的值

傳回

浮點二進位16值, short以最接近參數}的值編碼。轉換是在java.math.RoundingMode#HALF_EVEN四捨五入到最近偶數的模式下計算。

        Special cases:
        &lt;ul&gt;
        &lt;li&gt; If the argument is zero, the result is a zero with the
        same sign as the argument.
        &lt;li&gt; If the argument is infinite, the result is an infinity
        with the same sign as the argument.
        &lt;li&gt; If the argument is a NaN, the result is a NaN.
        &lt;/ul&gt;

        The binary16 format is discussed in
        more detail in the <code data-dev-comment-type="c">#float16ToFloat</code> method.
屬性

備註

{

20 年加進。

Java 文件 java.lang.Float.floatToFloat16(float)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於