ebi_arithmetic/fraction/
fraction.rs1#[cfg(any(
4 all(
5 not(feature = "exactarithmetic"),
6 not(feature = "approximatearithmetic")
7 ),
8 all(feature = "exactarithmetic", feature = "approximatearithmetic")
9))]
10pub type Fraction = super::fraction_enum::FractionEnum;
11
12#[cfg(all(not(feature = "exactarithmetic"), feature = "approximatearithmetic"))]
13pub type Fraction = super::fraction_f64::FractionF64;
14
15#[cfg(all(feature = "exactarithmetic", not(feature = "approximatearithmetic")))]
16pub type Fraction = super::fraction_exact::FractionExact;
17
18pub const APPROX_DIGITS: u64 = 5;
21pub const EPSILON: f64 = 1e-13;
22
23#[macro_export]
24macro_rules! f {
26 ($e: expr) => {
27 Fraction::from($e)
28 };
29
30 ($e: expr, $f: expr) => {
31 Fraction::from(($e, $f))
32 };
33}
34pub use f;
35
36#[macro_export]
37macro_rules! f0 {
39 () => {
40 Fraction::zero()
41 };
42}
43pub use f0;
44
45#[macro_export]
46macro_rules! f1 {
48 () => {
49 Fraction::one()
50 };
51}
52pub use f1;