cosmic-text/src/math.rs
Christopher Serr 8582173128 Fix no_std build
This fixes the `no_std` build and also makes sure it's tested properly
in the CI workflow.
2024-02-12 10:37:49 -07:00

14 lines
225 B
Rust

#[cfg(not(feature = "std"))]
pub use libm::{roundf, truncf};
#[cfg(feature = "std")]
#[inline]
pub fn roundf(x: f32) -> f32 {
x.round()
}
#[cfg(feature = "std")]
#[inline]
pub fn truncf(x: f32) -> f32 {
x.trunc()
}