MikeLankamp / fpm

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

feat: add fixed-to-fixed conversion #10

Closed MikeLankamp closed 3 years ago

MikeLankamp commented 3 years ago

fpm::fixed<A, B, C> can now be constructed from an fpm::fixed<D, E, F> via explicit construction. This allows for conversion between fixed-point numbers of differing precision and range. Depending on the respective underlying types and number of fraction bits, this conversion may throw away high bits in the integral or low bits in the fraction.

Closes #9