[src]

Function std::num::signum

pub fn signum<T: Signed>(value: T) -> T

Returns the sign of the number.

For float, f32, f64: - 1.0 if the number is positive, +0.0 or INFINITY - -1.0 if the number is negative, -0.0 or NEG_INFINITY - NAN if the number is NAN

For int: - 0 if the number is zero - 1 if the number is positive - -1 if the number is negative