Float.FloatToFloat16(Single) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
{
[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:
<ul>
<li> If the argument is zero, the result is a zero with the
same sign as the argument.
<li> If the argument is infinite, the result is an infinity
with the same sign as the argument.
<li> If the argument is a NaN, the result is a NaN.
</ul>
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 所創建與分享的作品,並依授權條款所描述的使用進行修改。