Function spinoso_math::asin

source ·
pub fn asin(value: f64) -> Result<f64, DomainError>
Expand description

Computes the arcsine of the given value. Returns results in the range (-PI/2..=PI/2).

Domain: [-1, -1]

Codomain: [-PI/2, PI/2]


use spinoso_math as math;
assert_eq!(math::asin(1.0), Ok(PI / 2.0));

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


If the result of computing the arcsine is NAN, a domain error is returned.