Skip to main content

Module cos

Module cos 

Source
Expand description

Implementations of Cos and CosAssign, traits for computing the cosine of Floats.

Functionsยง

primitive_float_cos
Computes $\cos x$, the cosine of a primitive float. Using this function is more accurate than using the default cos function or the one provided by libm.
primitive_float_cos_pi
Computes $\cos(\pi x)$, the cosine of a primitive float measured in half-turns.
primitive_float_cos_pi_rational
Computes $\cos(\pi x)$, the cosine of a Rational measured in half-turns, returning the result as a primitive float.
primitive_float_cos_rational
Computes $\cos x$, the cosine of a Rational, returning the result as a primitive float.
primitive_float_cos_with_period
Computes $\cos(2\pi x/u)$, the cosine of a primitive float measured in $u$ths of a turn (so that u = 360 is degrees).
primitive_float_cos_with_period_rational
Computes $\cos(2\pi x/u)$, the cosine of a Rational measured in $u$ths of a turn (so that u = 360 is degrees), returning the result as a primitive float.