spinoso_math

Function 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]

§Examples

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

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

§Errors

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