John McFarlane

Results 88 issues of 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...

help wanted

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.

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.

P0037
P0554

https://en.wikipedia.org/wiki/Scientific_notation#Other_bases http://en.cppreference.com/w/cpp/language/floating_literal

Design

https://github.com/google/benchmark#preventing-optimisation

Reference Implementation

https://github.com/foonathan/type_safe

Reference Implementation