cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pi.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_PI_H
4#define pRC_CORE_VALUE_FUNCTIONS_PI_H
5
8
9namespace pRC
10{
11 template<IsFloat T>
12 static inline constexpr T pi()
13 {
14 if constexpr(IsSame<T, BFloat16>)
15 {
16 return BFloat16::FromRepresentation(0x4049);
17 }
18 else
19 {
20 return 3.141592653589793238462643383279502884;
21 }
22 }
23
24 static inline constexpr auto pi()
25 {
26 return pi<Float<>>();
27 }
28}
29#endif // pRC_CORE_VALUE_FUNCTIONS_PI_H
static constexpr auto FromRepresentation(Representation const rep)
Definition bfloat16.hpp:24
Definition value.hpp:12
Definition concepts.hpp:28
Definition cholesky.hpp:10
static constexpr T pi()
Definition pi.hpp:12