Method SignFloat
- Namespace
- Zyl.VectorTraits
- Assembly
- VectorTraits.dll
SignFloat(float)
Computes the sign of a value and returns a floating point number (计算值的符号并返回浮点数).
public static float SignFloat(float value)
Parameters
value
floatThe value whose sign is to be computed (要计算其符号的值)
Returns
- float
Returns 1 if the value is positive, 0 if the value is zero, -1 if the value is negative, and
NaN
if the value isNaN
(值为正数时返回1, 值为0时返回0, 值为负数时返回-1, 值为NaN
时返回NaN
).
Remarks
No exception is thrown. For the NaN
of float types, returns NaN
.(不会抛出异常. 对于浮点类型的 NaN
, 会返回 NaN
).
- See Also
-
Sign(TSelf)
SignFloat(double)
Computes the sign of a value and returns a floating point number (计算值的符号并返回浮点数).
public static double SignFloat(double value)
Parameters
value
doubleThe value whose sign is to be computed (要计算其符号的值)
Returns
- double
Returns 1 if the value is positive, 0 if the value is zero, -1 if the value is negative, and
NaN
if the value isNaN
(值为正数时返回1, 值为0时返回0, 值为负数时返回-1, 值为NaN
时返回NaN
).
Remarks
No exception is thrown. For the NaN
of float types, returns NaN
.(不会抛出异常. 对于浮点类型的 NaN
, 会返回 NaN
).
- See Also
-
Sign(TSelf)
SignFloat(Half)
Computes the sign of a value and returns a floating point number (计算值的符号并返回浮点数).
public static Half SignFloat(Half value)
Parameters
value
HalfThe value whose sign is to be computed (要计算其符号的值)
Returns
- Half
Returns 1 if the value is positive, 0 if the value is zero, -1 if the value is negative, and
NaN
if the value isNaN
(值为正数时返回1, 值为0时返回0, 值为负数时返回-1, 值为NaN
时返回NaN
).
Remarks
No exception is thrown. For the NaN
of float types, returns NaN
.(不会抛出异常. 对于浮点类型的 NaN
, 会返回 NaN
).
- See Also
-
Sign(TSelf)