|
CeresEngine 0.2.0
A game development framework
|
#include <CeresEngine/Math/FixedPoint.hpp>
Public Types | |
| using | Self = FixedPoint< T, P > |
| The fixed point type itself. | |
Public Member Functions | |
| constexpr | FixedPoint ()=default |
Creates a new fixed-point number and initializes it with 0.0. | |
| constexpr | FixedPoint (T raw) noexcept |
Creates a new fixed-point number and initializes it with the given raw integer value. | |
| constexpr | FixedPoint (const FixedPoint &)=default |
| Creates a new fixed-point number by copying another. | |
| constexpr FixedPoint & | operator= (const FixedPoint &)=default |
| Assigns the fixed-point number by copying another. | |
| constexpr | FixedPoint (float f) noexcept |
Creates a new fixed-point number from an existing float value. | |
| constexpr | operator float () const |
Converts the fixed-point number to a float value. | |
| constexpr | FixedPoint (const double d) noexcept |
Creates a new fixed-point number from an existing double value. | |
| constexpr | operator double () const |
Converts the fixed-point number to a double value. | |
| constexpr | FixedPoint (long double d) noexcept |
Creates a new fixed-point number from an existing double value. | |
| constexpr | operator long double () const |
Converts the fixed-point number to a double value. | |
| template<typename TT , unsigned int TP> | |
| constexpr | FixedPoint (const FixedPoint< TT, TP > &other) |
| Creates a new fixed-point number by converting representation from another fixed-point. | |
| template<typename TT , unsigned int TP> | |
| TT | convert () const |
Public Attributes | |
| T | raw |
| The underlying integer value. | |
Static Public Attributes | |
| static const constexpr T | one = T(1) << P |
The integer value that best represents 1.000.... | |
| T | the fixed-point underlying integer type |
| P | the number of bits dedicated to the fixed-point |
| using Math::FixedPoint< T, P >::Self = FixedPoint<T, P> |
The fixed point type itself.
Used to avoid automatic template deduction on operator arguments.
|
constexprdefault |
Creates a new fixed-point number and initializes it with 0.0.
|
inlineexplicitconstexprnoexcept |
Creates a new fixed-point number and initializes it with the given raw integer value.
| raw | The raw integer value to initialize with |
|
constexprdefault |
Creates a new fixed-point number by copying another.
|
inlineconstexprnoexcept |
Creates a new fixed-point number from an existing float value.
| f | The floating-point value to be converted |
|
inlineconstexprnoexcept |
Creates a new fixed-point number from an existing double value.
| d | The floating-point value to be converted |
|
inlineconstexprnoexcept |
Creates a new fixed-point number from an existing double value.
| d | The floating-point value to be converted |
|
inlineconstexpr |
Creates a new fixed-point number by converting representation from another fixed-point.
| TT | the target underlying type |
| TP | the target underlying precision |
| other | The instance to be converted |
|
inline |
|
inlineexplicitconstexpr |
Converts the fixed-point number to a double value.
double value
|
inlineexplicitconstexpr |
Converts the fixed-point number to a float value.
float value
|
inlineexplicitconstexpr |
Converts the fixed-point number to a double value.
double value
|
constexprdefault |
Assigns the fixed-point number by copying another.
*this
|
staticconstexpr |
The integer value that best represents 1.000....
| T Math::FixedPoint< T, P >::raw |
The underlying integer value.