Table of Contents

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 float

The 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 is NaN (值为正数时返回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 double

The 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 is NaN (值为正数时返回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 Half

The 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 is NaN (值为正数时返回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)