diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/fixed_point.h | 3 |
1 files changed, 3 insertions, 0 deletions
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 <type_traits> 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; }; |
