FixedMath.hpp File Reference
#include <PlayRho/Common/Fixed.hpp>
#include <cmath>

Go to the source code of this file.

Namespaces

 playrho
 
 playrho::detail
 

Functions

template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed< BT, FB > playrho::abs (Fixed< BT, FB > arg)
 Computes the absolute value. More...
 
template<typename BT , unsigned int FB>
constexpr Fixed< BT, FB > playrho::pow (Fixed< BT, FB > value, int n)
 Computes the value of the given number raised to the given power. More...
 
constexpr auto playrho::detail::factorial (std::int64_t n)
 Computes the factorial. More...
 
template<typename BT , unsigned int FB, int N = 6>
constexpr Fixed< BT, FB > playrho::detail::exp (Fixed< BT, FB > arg)
 Computes Euler's number raised to the given power argument. More...
 
template<typename BT , unsigned int FB, int N = 6>
Fixed< BT, FB > playrho::detail::log (Fixed< BT, FB > arg)
 Computes the natural logarithm. More...
 
template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed< BT, FB > playrho::detail::sin (Fixed< BT, FB > arg)
 Computes the sine of the given argument via Maclaurin series approximation. More...
 
template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed< BT, FB > playrho::detail::cos (Fixed< BT, FB > arg)
 Computes the cosine of the given argument via Maclaurin series approximation. More...
 
template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed< BT, FB > playrho::detail::atan (Fixed< BT, FB > arg)
 Computes the arctangent of the given argument via Maclaurin series approximation. More...
 
template<typename BT , unsigned int FB>
constexpr auto playrho::detail::ComputeSqrt (Fixed< BT, FB > arg)
 Computes the square root of a non-negative value. More...
 
template<typename BT , unsigned int FB>
constexpr Fixed< BT, FB > playrho::trunc (Fixed< BT, FB > arg)
 Truncates the given value. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::nextafter (Fixed< BT, FB > from, Fixed< BT, FB > to) noexcept
 Next after function for Fixed types. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::fmod (Fixed< BT, FB > dividend, Fixed< BT, FB > divisor) noexcept
 Computes the remainder of the division of the given dividend by the given divisor. More...
 
template<typename BT , unsigned int FB>
auto playrho::sqrt (Fixed< BT, FB > arg)
 Square root's the given value. More...
 
template<typename BT , unsigned int FB>
bool playrho::isnormal (Fixed< BT, FB > arg)
 Gets whether the given value is normal - i.e. not 0 nor infinite. More...
 
template<typename BT , unsigned int FB>
auto playrho::detail::AngularNormalize (Fixed< BT, FB > angleInRadians)
 Normalizes the given angular argument. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::sin (Fixed< BT, FB > arg)
 Computes the sine of the argument for Fixed types. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::cos (Fixed< BT, FB > arg)
 Computes the cosine of the argument for Fixed types. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::atan (Fixed< BT, FB > arg)
 Computes the arc tangent. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::atan2 (Fixed< BT, FB > y, Fixed< BT, FB > x)
 Computes the multi-valued inverse tangent. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::log (Fixed< BT, FB > arg)
 Computes the natural logarithm of the given argument. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::exp (Fixed< BT, FB > arg)
 Computes the Euler number raised to the power of the given argument. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::pow (Fixed< BT, FB > base, Fixed< BT, FB > exponent)
 Computes the value of the base number raised to the power of the exponent. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::hypot (Fixed< BT, FB > x, Fixed< BT, FB > y)
 Computes the square root of the sum of the squares. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > playrho::round (Fixed< BT, FB > value) noexcept
 Rounds the given value. More...
 
template<typename BT , unsigned int FB>
bool playrho::signbit (Fixed< BT, FB > value) noexcept
 Determines whether the given value is negative. More...
 
template<typename BT , unsigned int FB>
PLAYRHO_CONSTEXPR bool playrho::isnan (Fixed< BT, FB > value) noexcept
 Gets whether the given value is not-a-number. More...
 
template<typename BT , unsigned int FB>
bool playrho::isfinite (Fixed< BT, FB > value) noexcept
 Gets whether the given value is finite. More...
 

Variables

template<typename BT , unsigned int FB>
constexpr const auto playrho::detail::FixedPi = Fixed<BT, FB>{3.14159265358979323846264338327950288}
 Fixed point pi value. More...