method i64.signum
-1, 0 or 1 for a negative, zero or positive value.
Example:
fn main() io {
let neg: i64 = -5
let zero: i64 = 0
let pos: i64 = 9
print("{neg.signum()} {zero.signum()} {pos.signum()}")
}Output
-1 0 1
pub(api) fn signum() -> i64Complexity. O(1).
Since. 1.0.0-beta
Returns
i64
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/numbers.oxl:259