Function ndarray_rand::rand_distr::num_traits::signum
source ยท pub fn signum<T>(value: T) -> Twhere
T: Signed,
Expand description
Returns the sign of the number.
For f32
and f64
:
1.0
if the number is positive,+0.0
orINFINITY
-1.0
if the number is negative,-0.0
orNEG_INFINITY
NaN
if the number isNaN
For signed integers:
0
if the number is zero1
if the number is positive-1
if the number is negative