diff options
| author | batsumaru <> | 2026-08-09 12:00:27 +0900 |
|---|---|---|
| committer | batsumaru <> | 2026-08-09 12:00:27 +0900 |
| commit | 9d4f68606c919791d44e86e7a50812c29be32fa3 (patch) | |
| tree | 7228c33d006f994f5b45f6634af40d4c08bf6c7c /src | |
| parent | 5a0e17e6a406805e830fc78b681656d0c7e88748 (diff) | |
Add fp_t subtraction
Diffstat (limited to 'src')
| -rw-r--r-- | src/fixed_point.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fixed_point.cpp b/src/fixed_point.cpp index 7ff77a0..9b2d8e2 100644 --- a/src/fixed_point.cpp +++ b/src/fixed_point.cpp @@ -4,6 +4,10 @@ fp_t fp_t::operator+(const fp_t& other) const { return {(int32_t)((uint32_t)raw + (uint32_t)other.raw)}; } +fp_t fp_t::operator-(const fp_t& other) const { + return {(int32_t)((uint32_t)raw - (uint32_t)other.raw)}; +} + bool fp_t::operator==(const fp_t& other) const { return raw == other.raw; } |
