numaxiom 0.0.2

Lightweight numeric marker traits for ranges/signs plus constants and ops; std by default, no_std optional.
Documentation
/// Arccosine helper.
///
/// Contract (minimum): return the principal value of arccosine. Implementers
/// must document the valid input domain (typically [-1, 1]), handling of out-
/// of-range inputs/NaN/∞, and accuracy guarantees.
pub trait Acos: Sized {
    fn acos(self) -> Self;
}

#[cfg(any(feature = "std", feature = "libm"))]
mod float_impls {
    use super::Acos;

    #[inline]
    fn acos_f32(x: f32) -> f32 {
        #[cfg(feature = "libm")]
        {
            libm::acosf(x)
        }
        #[cfg(not(feature = "libm"))]
        {
            f32::acos(x)
        }
    }

    #[inline]
    fn acos_f64(x: f64) -> f64 {
        #[cfg(feature = "libm")]
        {
            libm::acos(x)
        }
        #[cfg(not(feature = "libm"))]
        {
            f64::acos(x)
        }
    }

    macro_rules! impl_acos_for_float {
        ($ty:ty, $fn:ident) => {
            impl Acos for $ty {
                fn acos(self) -> Self {
                    $fn(self)
                }
            }
        };
    }

    impl_acos_for_float!(f32, acos_f32);
    impl_acos_for_float!(f64, acos_f64);
}