numaxiom 0.0.2

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

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

    #[inline]
    fn asin_f32(x: f32) -> f32 {
        #[cfg(feature = "libm")]
        {
            libm::asinf(x)
        }
        #[cfg(not(feature = "libm"))]
        {
            f32::asin(x)
        }
    }

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

    macro_rules! impl_asin_for_float {
        ($ty:ty, $fn:ident) => {
            impl Asin for $ty {
                fn asin(self) -> Self {
                    $fn(self)
                }
            }
        };
    }

    impl_asin_for_float!(f32, asin_f32);
    impl_asin_for_float!(f64, asin_f64);
}