Skip to main content

fract

Function fract 

Source
pub fn fract<T: Real>(x: T) -> T
Expand description

Fractional part: x - floor(x). Negative inputs give [0, 1).

ยงExamples

use mathverse_core::ops::fract;

assert!((fract(2.75_f64) - 0.75).abs() < 1e-12);
assert!((fract(-0.25_f64) - 0.75).abs() < 1e-12);