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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! No-STD abstraction layer enabling numerical functions to be implemented once, and simultaneously support both real and complex numbers with, int, fixed and floating point types.
//!
//! This is an experimental library.
//!
//! ## Example
//!
//! ```
//! use mixed_num::*;
//! use mixed_num::traits::*;
//! use fixed::{types::extra::U27, FixedI32};
//!
//! let number = FixedI32::<U27>::from_num(0.6f32);
//! let res:f32 = number.mixed_atan().mixed_to_num();
//!
//! assert_eq!{ res, 0.5404195 };
//!
//! let number = 0.6f32;
//! let res:f32 = number.mixed_atan().mixed_to_num();
//!
//! assert_eq!{ res, 0.5404195 };
//! ```
//!
//!
//! The library supplies complex structs `Polar<T>` and `Cartesian<T>` with no-std implementation of math traits, including `MixedNum` traits.
//!
//! Some interoperability with num::Complex is implemented.
//!
//! ## Example
//!
//! ```
//! use mixed_num::*;
//! use mixed_num::traits::*;
//!
//! let number = Cartesian::new(1f32,2f32);
//!
//! assert_eq!{ number.to_string(), "1+2i" };
//!
//! let polar_number = number.to_polar();
//! assert_eq!{ polar_number.to_string(), "2.236068∠1.1071488" };
//!
//! let polar_conj: Polar<f32> = polar_number.conj();
//!
//! assert_eq!{ polar_conj.to_string(), "2.236068∠-1.1071488" };
//! ```
//!
//! Selected `core::ops` traits are implemented on the complex structs.
//!
//! ## Example
//!
//! ```
//! use mixed_num::*;
//! use mixed_num::traits::*;
//!
//! let mut c_num = Cartesian::new(1f32,2f32);
//!
//! c_num = c_num*c_num;
//! assert_eq!{ c_num.to_string(), "-3+4i" };
//! ```
//!
//! This includes support for operation of mixed types.
//!
//! ## Example
//!
//! ```
//! use mixed_num::*;
//! use mixed_num::traits::*;
//!
//! let mut c_num = Cartesian::new(1f32,2f32);
//!
//! c_num = c_num*2f64;
//! assert_eq!{ c_num.to_string(), "2+4i" };
//! ```
extern crate std;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;