fixed_point
fixed_point copied to clipboard
C++ Binary Fixed-Point Arithmetic
In ```c++ auto a = fixed_point(0x100000000LL); auto b = fixed_point(1); ASSERT_GT(a, b); ``` expression overflows. But only 16 (maybe 15) bits of range are required to scale operands such that...
E.g. an instruction that multiplies with saturation, then shifts right by 15 digits.
https://en.wikipedia.org/wiki/Scientific_notation#Other_bases http://en.cppreference.com/w/cpp/language/floating_literal
https://github.com/google/benchmark#preventing-optimisation