Function spinoso_math::acosh[][src]

pub fn acosh(value: f64) -> Result<f64, DomainError>
Expand description

Computes the inverse hyperbolic cosine of the given value.

Domain: [1, INFINITY)

Codomain: [0, INFINITY)

Examples

use spinoso_math as math;
assert_eq!(math::acosh(1.0), Ok(0.0));
assert!(math::acosh(0.0).is_err());

assert!(matches!(math::acosh(f64::NAN), Ok(result) if result.is_nan()));

Errors

If the result of computing the inverse hyperbolic cosine is NAN, a domain error is returned.