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
use crate::soft_f64::SoftF64;

type F = SoftF64;

impl From<f64> for F {
    fn from(value: f64) -> Self {
        F::from_f64(value)
    }
}

impl PartialEq<Self> for F {
    fn eq(&self, other: &Self) -> bool {
        match self.cmp(*other) {
            Some(core::cmp::Ordering::Equal) => true,
            _ => false,
        }
    }
}

impl PartialOrd for F {
    fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
        self.cmp(*other)
    }
}

impl core::ops::Add for F {
    type Output = Self;

    fn add(self, rhs: Self) -> Self::Output {
        F::add(self, rhs)
    }
}

impl core::ops::Sub for F {
    type Output = Self;

    fn sub(self, rhs: Self) -> Self::Output {
        F::sub(self, rhs)
    }
}

impl core::ops::Mul for F {
    type Output = Self;

    fn mul(self, rhs: Self) -> Self::Output {
        F::mul(self, rhs)
    }
}

impl core::ops::Div for F {
    type Output = Self;

    fn div(self, rhs: Self) -> Self::Output {
        F::div(self, rhs)
    }
}

impl core::ops::AddAssign for F {
    fn add_assign(&mut self, rhs: Self) {
        *self = *self + rhs;
    }
}

impl core::ops::SubAssign for F {
    fn sub_assign(&mut self, rhs: Self) {
        *self = *self - rhs;
    }
}