fixed_point (deprecated)  rev.2
Binary Fixed-Point Arithmetic Library in C++
sg14::literals Namespace Reference

generate an sg14::elastic_fixed_point object using a literal More...

Detailed Description

generate an sg14::elastic_fixed_point object using a literal

Template Parameters
Digitsthe characters of the literal sequence
Returns
the given value to be represented using an sg14::elastic_fixed_point type
Note
The return type is guaranteed to be no larger than is necessary to represent the maximum value of Integral.
Example

To define an int-sized object with value 1536:

using namespace sg14::literals;
constexpr auto n = 34_elastic;
static_assert(n==34, "n now has the value, 1536");
static_assert(std::is_same<decltype(n), const elastic_fixed_point<6, -1>>::value, "type only uses 1 bit of range");