method f32.round
The nearest integer value as a float (halves round away from zero).
Example:
fn main() io {
let x: f32 = 2.5
print("{x.round()}")
}Output
3.0
pub(api) fn round() -> f32Complexity. O(1).
Since. 1.0.0-beta
Returns
f32
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/numbers.oxl:4273