#include "fixed_point.h" 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)}; } fp_t fp_t::operator*(const fp_t& other) const { int32_t result; int64_t temp; temp = (int64_t)raw * (int64_t)other.raw; temp += fp_t::K; result = (int32_t)(temp >> fp_t::Q); return {result}; } bool fp_t::operator==(const fp_t& other) const { return raw == other.raw; }