1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! # Trigonometric functions for fixed numbers.
//!
//! The following functions are implemented in some capacity:
//!
//! - sqrt
//! - sin_cos, sin, cos, tan
//!
//! _(May add pow and exp later...)_
//!
//! They have different constraints and may panic or return wrong values if called with the wrong number representation.
//!
//! The trait implementations ([SinCos], [Sqrt]) could not be implemented for all valid types, use the functions for those.
//!
//! ## Example
//!
//! ```
//! use fixed::types::I32F32;
//! use fixed_math::Sqrt;
//! use fixed_math::sqrt::sqrt_i;
//!
//! let f = I32F32::from_num(4.0);
//!
//! assert_eq!(f.sqrt(), I32F32::from_num(2.0));
//! assert_eq!(sqrt_i(f), I32F32::from_num(2.0));
//! ```
pub use *;
pub