cMHN
1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pRC
prc
core
value
functions
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
6
#include <
prc/core/value/float.hpp
>
7
#include <
prc/core/value/value.hpp
>
8
9
namespace
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
pRC::BFloat16::FromRepresentation
static constexpr auto FromRepresentation(Representation const rep)
Definition
bfloat16.hpp:24
pRC::Float
Definition
value.hpp:12
pRC::IsSame
Definition
concepts.hpp:28
float.hpp
pRC
Definition
cholesky.hpp:10
pRC::pi
static constexpr T pi()
Definition
pi.hpp:12
value.hpp
Generated by
1.11.0