Plasma Engine  2.0
Loading...
Searching...
No Matches
Constants.h
1#pragma once
2
3#include <Foundation/Math/Declarations.h>
4
5namespace plMath
6{
8 template <typename TYPE>
9 constexpr TYPE Pi();
10
12 template <typename TYPE>
13 constexpr TYPE e();
14
16 template <typename TYPE>
17 constexpr bool SupportsNaN();
18
23 template <typename TYPE>
24 constexpr TYPE NaN();
25
27 template <typename TYPE>
28 constexpr bool SupportsInfinity();
29
31 template <typename TYPE>
32 constexpr TYPE Infinity();
33
35 template <typename TYPE>
36 constexpr TYPE MaxValue();
37
39 template <typename TYPE>
40 constexpr TYPE MinValue();
41
45 template <typename TYPE>
46 constexpr TYPE HighValue();
47
49 template <typename TYPE>
50 constexpr TYPE FloatEpsilon();
51
52 template <typename TYPE>
53 constexpr TYPE SmallEpsilon();
54
55 template <typename TYPE>
56 constexpr TYPE DefaultEpsilon();
57
58 template <typename TYPE>
59 constexpr TYPE LargeEpsilon();
60
61 template <typename TYPE>
62 constexpr TYPE HugeEpsilon();
63
65 template <typename TYPE>
66 constexpr plUInt32 NumBits();
67} // namespace plMath
68
69
70#include <Foundation/Math/Implementation/Constants_inl.h>
This namespace provides common math-functionality as functions.
Definition Constants.h:6
constexpr TYPE Pi()
Returns the natural constant Pi.
constexpr TYPE Infinity()
Returns the value for Infinity as the template type. Returns zero, if the type does not support Infin...
Definition Constants_inl.h:110
constexpr bool SupportsInfinity()
Returns whether the template type supports specialized values to represent Infinity.
Definition Constants_inl.h:90
constexpr TYPE FloatEpsilon()
The difference between 1.0 and the next representable value for the given type.
constexpr TYPE MaxValue()
Returns the largest possible positive value (that is not infinity).
constexpr TYPE HighValue()
A very large value, that is slightly smaller than sqrt(MaxValue()).
constexpr TYPE NaN()
Returns the value for NaN as the template type. Returns zero, if the type does not support NaN.
Definition Constants_inl.h:58
constexpr TYPE e()
Returns the natural constant e.
constexpr plUInt32 NumBits()
Returns the number of bits in the given type. Mostly useful for unsigned integer types.
constexpr TYPE MinValue()
Returns the smallest possible value (that is not -infinity). Usually zero or -MaxValue()....
constexpr bool SupportsNaN()
Returns whether the template type supports specialized values to represent NaN.
Definition Constants_inl.h:38