opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
constants.h
Go to the documentation of this file.
1#pragma once
2
3#include <concepts>
4#include <limits>
5#include <numbers>
6
7namespace osc
8{
9 // the mathematical constant, pi
10 template<std::floating_point T>
11 static inline constexpr T pi_v = std::numbers::pi_v<T>;
12
13 // the difference between `T{1}` and the next representable value of the given floating-point type
14 template<std::floating_point T>
15 static inline constexpr T epsilon_v = std::numeric_limits<T>::epsilon();
16
17 // a quiet Not-a-Number (NaN) value of the given floating-point type
18 template<std::floating_point T>
19 static inline constexpr T quiet_nan_v = std::numeric_limits<T>::quiet_NaN();
20
21 // A multiplier that converts a degree value of type `T` to radians.
22 template<std::floating_point T>
23 static inline constexpr T deg_to_rad_v = pi_v<T> / T{180};
24
25 // A multiplier that converts a radians value of type `T` to degrees.
26 template<std::floating_point T>
27 static inline constexpr T rad_to_deg_v = T{180} / pi_v<T>;
28}
Definition custom_decoration_generator.h:5
constexpr U to(T &&value)
Definition conversion.h:56