From 7bb49794297b46aa1c577e89da24d39b4348c6d4 Mon Sep 17 00:00:00 2001 From: batsumaru <> Date: Sun, 9 Aug 2026 12:39:50 +0900 Subject: Added fp_t multiplication --- include/fixed_point.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/fixed_point.h') diff --git a/include/fixed_point.h b/include/fixed_point.h index 1bdc5df..ff8e2b3 100644 --- a/include/fixed_point.h +++ b/include/fixed_point.h @@ -5,6 +5,8 @@ #include struct fp_t { + static constexpr int32_t Q = 16; + static constexpr int32_t K = 1 << (Q - 1); std::int32_t raw; static constexpr fp_t from_raw(std::int32_t r) { return fp_t{r}; } @@ -12,6 +14,7 @@ struct fp_t { fp_t operator+(const fp_t& other) const; fp_t operator-(const fp_t& other) const; + fp_t operator*(const fp_t& other) const; bool operator==(const fp_t& other) const; }; -- cgit v1.3