ToyGine2 26.2.0
Game Engine for retro consoles
Loading...
Searching...
No Matches
fixed.inl File Reference

Inline implementations for toy::math::fixed. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  toy
 Root namespace containing all engine modules.
namespace  toy::math
 Mathematical types, constants, and utilities: fixed-point, vectors, point.

Functions

template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator- (const fixed< Base, Intermediate, Fraction, Rounding > &value) noexcept
 Unary minus: returns the negation of a toy::math::fixed value.
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, bool OtherRounding>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator+ (const fixed< Base, Intermediate, Fraction, Rounding > &a, const fixed< Base, Intermediate, Fraction, OtherRounding > &b) noexcept
 Returns a + b as a new toy::math::fixed (same type as left operand).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, typename T>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator+ (const fixed< Base, Intermediate, Fraction, Rounding > &a, const T &b) noexcept
 Returns a + b as a new toy::math::fixed (fixed plus integral whole units).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, typename T>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator+ (const T &a, const fixed< Base, Intermediate, Fraction, Rounding > &b) noexcept
 Returns a + b as a new toy::math::fixed (integral whole units plus fixed).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, bool OtherRounding>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator- (const fixed< Base, Intermediate, Fraction, Rounding > &a, const fixed< Base, Intermediate, Fraction, OtherRounding > &b) noexcept
 Returns a - b as a new toy::math::fixed (same type as left operand).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, typename T>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator- (const fixed< Base, Intermediate, Fraction, Rounding > &a, const T &b) noexcept
 Returns a - b as a new toy::math::fixed (fixed minus integral whole units).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, typename T>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator- (const T &a, const fixed< Base, Intermediate, Fraction, Rounding > &b) noexcept
 Returns a - b as a new toy::math::fixed (integral whole units minus fixed).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, bool OtherRounding>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator* (const fixed< Base, Intermediate, Fraction, Rounding > &a, const fixed< Base, Intermediate, Fraction, OtherRounding > &b) noexcept
 Returns a * b as a new toy::math::fixed (same type as left toy::math::fixed operand).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, typename T>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator* (const fixed< Base, Intermediate, Fraction, Rounding > &a, const T &b) noexcept
 Returns a * b as a new toy::math::fixed (fixed times integral whole units).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, typename T>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator* (const T &a, const fixed< Base, Intermediate, Fraction, Rounding > &b) noexcept
 Returns a * b as a new toy::math::fixed (integral whole units times fixed).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, bool OtherRounding>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator/ (const fixed< Base, Intermediate, Fraction, Rounding > &a, const fixed< Base, Intermediate, Fraction, OtherRounding > &b) noexcept
 Returns a / b as a new toy::math::fixed.
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, typename T>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator/ (const fixed< Base, Intermediate, Fraction, Rounding > &a, const T &b) noexcept
 Returns a / b as a new toy::math::fixed (fixed divided by integral whole units).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, typename T>
constexpr fixed< Base, Intermediate, Fraction, Rounding > toy::math::operator/ (const T &a, const fixed< Base, Intermediate, Fraction, Rounding > &b) noexcept
 Returns a / b as a new toy::math::fixed (integral whole units divided by fixed).
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, bool OtherRounding>
constexpr bool toy::math::operator== (const fixed< Base, Intermediate, Fraction, Rounding > &a, const fixed< Base, Intermediate, Fraction, OtherRounding > &b) noexcept
 Compares two toy::math::fixed values for equality.
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, integral T>
constexpr bool toy::math::operator== (const fixed< Base, Intermediate, Fraction, Rounding > &a, const T &b) noexcept
 Compares a toy::math::fixed value with an integral for equality.
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, integral T>
constexpr bool toy::math::operator== (const T &a, const fixed< Base, Intermediate, Fraction, Rounding > &b) noexcept
 Compares an integral with a toy::math::fixed value for equality.
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, bool OtherRounding>
constexpr strong_ordering toy::math::operator<=> (const fixed< Base, Intermediate, Fraction, Rounding > &a, const fixed< Base, Intermediate, Fraction, OtherRounding > &b) noexcept
 Three-way comparison of two toy::math::fixed values.
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, integral T>
constexpr strong_ordering toy::math::operator<=> (const fixed< Base, Intermediate, Fraction, Rounding > &a, const T &b) noexcept
 Three-way comparison of a toy::math::fixed value with an integral.
template<typename Base, typename Intermediate, unsigned Fraction, bool Rounding, integral T>
constexpr strong_ordering toy::math::operator<=> (const T &a, const fixed< Base, Intermediate, Fraction, Rounding > &b) noexcept
 Three-way comparison of an integral with a toy::math::fixed value.

Detailed Description

Inline implementations for toy::math::fixed.

Note
Included by math.hpp only; do not include this file directly.