fixed_point (deprecated)  rev.2
Binary Fixed-Point Arithmetic Library in C++
fixed_point_make.h
1 
2 // Copyright John McFarlane 2015 - 2016.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file ../LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
9 
10 #if !defined(SG14_MAKE_FIXED_H)
11 #define SG14_MAKE_FIXED_H 1
12 
13 #include "fixed_point_type.h"
14 
15 #include <sg14/bits/type_traits.h>
16 
18 namespace sg14 {
19 
38  template<int IntegerDigits, int FractionalDigits = 0, class Narrowest = signed>
39  using make_fixed = fixed_point<
40  set_digits_t<Narrowest, IntegerDigits+FractionalDigits>,
41  -FractionalDigits>;
42 
47  template<int IntegerDigits, int FractionalDigits = 0, class Narrowest = unsigned>
48  using make_ufixed = make_fixed<
49  IntegerDigits,
50  FractionalDigits,
51  typename make_unsigned<Narrowest>::type>;
52 }
53 
54 #endif // SG14_MAKE_FIXED_H
fixed_point< set_digits_t< Narrowest, IntegerDigits+FractionalDigits >, -FractionalDigits > make_fixed
specializes fixed_point with the given number of integer and fractional digits
Definition: fixed_point_make.h:41
literal real number approximation that uses fixed-point arithmetic
Definition: fixed_point_type.h:20
study group 14 of the C++ working group
Definition: const_integer.h:22