From 023cdad8fad56de0d2b155bdf7d25020a9d82a99 Mon Sep 17 00:00:00 2001 From: Myles Busig Date: Mon, 29 Jul 2024 22:47:37 -0600 Subject: [PATCH] Add fixed point subtraction --- include/mtl/fixed.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/mtl/fixed.hpp b/include/mtl/fixed.hpp index f4b708d..8ec057f 100644 --- a/include/mtl/fixed.hpp +++ b/include/mtl/fixed.hpp @@ -107,6 +107,12 @@ public: ARM_MODE constexpr fixed operator+(fixed rhs) const { return from_raw(x + rhs.x); } + /** + * \brief Fixed point subtraction + */ + ARM_MODE constexpr fixed operator-(fixed rhs) const { + return from_raw(x - rhs.x); + } /** * \brief Fixed point multiplication