libfxd
0.2.dev
A fixed-point library for C++.
Main Page
Related Pages
Namespaces
Concepts
Classes
Files
Examples
File List
File Members
Loading...
Searching...
No Matches
numbers.hpp
Go to the documentation of this file.
1
/*
2
* libfxd - a fixed-point library for C++
3
*
4
* Copyright 2023 Daniel K. O.
5
* SPDX-License-Identifier: Apache-2.0
6
*/
7
8
#ifndef LIBFXD_NUMBERS_HPP
9
#define LIBFXD_NUMBERS_HPP
10
11
#include <numbers>
12
13
#include "
concepts.hpp
"
14
15
17
namespace
std::numbers
{
18
19
#ifdef __cpp_lib_constexpr_cmath
20
# define LIBFXD_CONSTEXPR constexpr
21
#else
22
# define LIBFXD_CONSTEXPR const
23
#endif
24
25
#define LIBFXD_NUMBER(c) \
26
template<fxd::fixed_point Fxd> \
27
inline LIBFXD_CONSTEXPR \
28
Fxd c<Fxd> = Fxd{std::numbers:: c <typename std::numeric_limits<Fxd>::float_type>}
29
31
LIBFXD_NUMBER
(e_v);
32
34
LIBFXD_NUMBER
(egamma_v);
35
37
LIBFXD_NUMBER
(inv_pi_v);
38
40
LIBFXD_NUMBER
(inv_sqrt3_v);
41
43
LIBFXD_NUMBER
(inv_sqrtpi_v);
44
46
LIBFXD_NUMBER
(ln10_v);
47
49
LIBFXD_NUMBER
(ln2_v);
50
52
LIBFXD_NUMBER
(log10e_v);
53
55
LIBFXD_NUMBER
(log2e_v);
56
58
LIBFXD_NUMBER
(phi_v);
59
61
LIBFXD_NUMBER
(pi_v);
62
64
LIBFXD_NUMBER
(sqrt2_v);
65
67
LIBFXD_NUMBER
(sqrt3_v);
68
69
70
#undef LIBFXD_NUMBER
71
#undef LIBFXD_CONSTEXPR
72
73
}
74
75
#endif
concepts.hpp
std::numbers
Specialization for mathematical constants.
Definition:
numbers.hpp:17
LIBFXD_NUMBER
#define LIBFXD_NUMBER(c)
Definition:
numbers.hpp:25
include
fxd
numbers.hpp
Generated by
1.9.6