units
Use physical dimensions at compile-time or run-time.
rat.hpp
Go to the documentation of this file.
1 /// @file vnix/rat.hpp
2 /// @brief Typedefs for class vnix::rat::rational.
3 /// @copyright 2019 Thomas E. Vaughan; all rights reserved.
4 /// @license BSD Three-Clause; see LICENSE.
5 
6 #ifndef VNIX_RATIONAL_HPP
7 #define VNIX_RATIONAL_HPP
8 
9 #include <vnix/rat/rational.hpp>
10 
11 namespace vnix {
12 
13 
14 /// Bring class rational into vnix namespace.
15 /// @tparam NB Number of bits for numerator.
16 /// @tparam DB Number of bits for denominator.
17 template <unsigned NB, unsigned DB> using rational = rat::rational<NB, DB>;
18 
19 
20 /// Rational with five bits for numerator and three for denominator.
21 using rat8_t = rational<5, 3>;
22 
23 /// Rational with nine bits for numerator and seven for denominator.
24 using rat16_t = rational<9, 7>;
25 
26 /// Rational with 17 bits for numerator and 15 for denominator.
27 using rat32_t = rational<17, 15>;
28 
29 /// Rational with 33 bits for numerator and 31 for denominator.
30 using rat64_t = rational<33, 31>;
31 
32 
33 } // namespace vnix
34 
35 #endif // ndef VNIX_RATIONAL_HPP
Thomas E. Vaughan&#39;s public software.
Definition: rational.hpp:13