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.lang.Float.floatToFloat16(float)Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。