Function floor

const fn floor(x: f32) -> f32

Experimental version of floor in core. See f32::floor for details.

Examples

#![feature(core_float_math)]

use core::f32;

let f = 3.7_f32;
let g = 3.0_f32;
let h = -3.7_f32;

assert_eq!(f32::math::floor(f), 3.0);
assert_eq!(f32::math::floor(g), 3.0);
assert_eq!(f32::math::floor(h), -4.0);

This standalone function is for testing only. It will be stabilized as an inherent method.