John McFarlane
John McFarlane
Is it possible to produce a quotient in the form of a fixed_point object that saves on run-time `idiv`? When the divisor is not known at compile time but will...
At least some versions of GCC seem to have `fmod` marked as `constexpr`. Try to detect this reliably and support compile-time `auto n = wide_integer{1.23};` for some targets.
Failing test can be found in #320.
I.e. assert that int > INT_MIN
static constexpr auto a = cnl::elastic_number{0.3125}; static constexpr auto b = cnl::convert{}(a); static_assert(identical(cnl::elastic_number{0.5}, b),"Free rounding test1"); //Works static constexpr auto c = cnl::convert{}(a); static_assert(identical(cnl::elastic_number{0.25}, c),"Free rounding test2"); //Fails gives 0.75...
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