MikeLankamp / fpm

C++ header-only fixed-point math library
https://mikelankamp.github.io/fpm
MIT License
650 stars 79 forks source link

Assertion on output with m_value = -2147483648 #14

Closed Klummel69 closed 3 years ago

Klummel69 commented 3 years ago

The following test code leads to an assertion

fpm::fixed_16_16 x {fpm::fixed_16_16::from_raw_value(-2147483647 - 1) };
std::cout << x << std::endl;

Message: Assertion failed! File: fpm/ios.hpp, Line 99 Expression: value.raw >= 0

Reason in Line91: value.raw = -value.raw; not possible for INT32_MIN.