micromath 2.0.0

Embedded-friendly math library featuring fast floating point approximations (with small code size) for common arithmetic operations, trigonometry, 2D/3D vector types, statistical analysis, and quaternions. Optimizes for performance and small code size at the cost of precision.
Documentation
//! Floating point ceiling approximation for a single-precision float.

use super::F32;

impl F32 {
    /// Returns the smallest integer greater than or equal to a number.
    pub fn ceil(self) -> Self {
        -(-self).floor()
    }
}

#[cfg(test)]
mod tests {
    use super::F32;

    #[test]
    fn sanity_check() {
        assert_eq!(F32(-1.1).ceil().0, -1.0);
        assert_eq!(F32(-0.1).ceil().0, 0.0);
        assert_eq!(F32(0.0).ceil().0, 0.0);
        assert_eq!(F32(1.0).ceil().0, 1.0);
        assert_eq!(F32(1.1).ceil().0, 2.0);
        assert_eq!(F32(2.9).ceil().0, 3.0);
    }
}