rutil 0.2.0

A library containing utilities for creating programs in rust.
Documentation
/// Hyperbolic operations.
pub trait HyperbolicOps {
    /// Hyperbolic sine function.
    fn sinh(self) -> Self;

    /// Hyperbolic cosine function.
    fn cosh(self) -> Self;

    /// Hyperbolic tangent function.
    fn tanh(self) -> Self;

    /// Inverse hyperbolic sine function.
    fn asinh(self) -> Self;

    /// Inverse hyperbolic cosine function.
    fn acosh(self) -> Self;

    /// Inverse hyperbolic tangent function.
    fn atanh(self) -> Self;
}

/// Implements [`HyperbolicOps`].
macro_rules! impl_hyperbolic {
    ($($t:ty),*) => {
        $(impl HyperbolicOps for $t {
            #[inline] fn sinh(self) -> Self { self.sinh() }
            #[inline] fn cosh(self) -> Self { self.cosh() }
            #[inline] fn tanh(self) -> Self { self.tanh() }
            #[inline] fn asinh(self) -> Self { self.asinh() }
            #[inline] fn acosh(self) -> Self { self.acosh() }
            #[inline] fn atanh(self) -> Self { self.atanh() }
        })*
    };
}

impl_hyperbolic!(f32, f64);