[nnm] No Nonsense Math 0.5.0
A No-Nonsense, C++ 17, single-header-only Math library geared towards graphics programming.
Loading...
Searching...
No Matches
nnm Namespace Reference

Classes

class  Basis2
class  Basis3
class  Matrix2
class  Matrix3
class  Matrix4
class  Quaternion
class  Transform2
class  Transform3
class  Vector2
class  Vector2i
class  Vector3
class  Vector3i
class  Vector4

Typedefs

using Vector2f = Vector2<float>
using Vector2d = Vector2<double>
using Vector2ii = Vector2i<int>
using Vector2i8 = Vector2i<int8_t>
using Vector2i16 = Vector2i<int16_t>
using Vector2i32 = Vector2i<int32_t>
using Vector2i64 = Vector2i<int64_t>
using Vector2iu = Vector2i<unsigned int>
using Vector2u8 = Vector2i<uint8_t>
using Vector2u16 = Vector2i<uint16_t>
using Vector2u32 = Vector2i<uint32_t>
using Vector2u64 = Vector2i<uint64_t>
using Vector3f = Vector3<float>
using Vector3d = Vector3<double>
using Vector3ii = Vector3i<int>
using Vector3i8 = Vector3i<int8_t>
using Vector3i16 = Vector3i<int16_t>
using Vector3i32 = Vector3i<int32_t>
using Vector3i64 = Vector3i<int64_t>
using Vector3iu = Vector3i<unsigned int>
using Vector3u8 = Vector3i<uint8_t>
using Vector3u16 = Vector3i<uint16_t>
using Vector3u32 = Vector3i<uint32_t>
using Vector3u64 = Vector3i<uint64_t>
using Vector4f = Vector4<float>
using Vector4d = Vector4<double>
using QuaternionF = Quaternion<float>
using QuaternionD = Quaternion<double>
using Matrix2f = Matrix2<float>
using Matrix2d = Matrix2<double>
using Basis2f = Basis2<float>
using Basis2d = Basis2<double>
using Matrix3f = Matrix3<float>
using Matrix3d = Matrix3<double>
using Transform2f = Transform2<float>
using Transform2d = Transform2<double>
using Basis3f = Basis3<float>
using Basis3d = Basis3<double>
using Matrix4f = Matrix4<float>
using Matrix4d = Matrix4<double>
using Transform3f = Transform3<float>
using Transform3d = Transform3<double>

Functions

template<typename Real>
constexpr Real pi ()
template<typename Real>
constexpr Real epsilon ()
template<typename Num>
constexpr Num sign (const Num value)
template<typename Num>
constexpr Num abs (const Num value)
template<typename Num>
constexpr Num max (const Num a, const Num b)
template<typename Num, typename... Rest>
constexpr Num max (const Num first, const Rest... rest)
template<typename Real>
constexpr bool approx_zero (const Real value)
template<typename Real>
constexpr bool approx_equal (const Real a, const Real b)
template<typename Real>
constexpr bool approx_less (const Real a, const Real b)
template<typename Real>
constexpr bool approx_greater (const Real a, const Real b)
template<typename Real>
constexpr bool approx_less_equal (const Real a, const Real b)
template<typename Real>
constexpr bool approx_greater_equal (const Real a, const Real b)
template<typename Real>
constexpr bool approx_less_zero (const Real value)
template<typename Real>
constexpr bool approx_greater_zero (const Real value)
template<typename Real>
constexpr bool approx_less_equal_zero (const Real value)
template<typename Real>
constexpr bool approx_greater_equal_zero (const Real value)
template<typename Real>
Real ceil (const Real value)
template<typename Num>
constexpr Num clamp (const Num value, const Num min, const Num max)
template<typename Real>
Real sqrt (const Real value)
template<typename Real>
Real pow (const Real base, const Real power)
template<typename Num>
constexpr Num sqrd (const Num value)
template<typename Real>
Real modf (const Real dividend, const Real divisor)
template<typename Int>
constexpr Int mod (const Int dividend, const Int divisor)
template<typename Real>
Real remf (const Real dividend, const Real divisor)
template<typename Int>
constexpr Int rem (const Int dividend, const Int divisor)
template<typename Real>
Real normalize_angle (const Real angle)
template<typename Real>
bool angle_in_range (const Real angle, const Real from, const Real to)
template<typename Real>
Real floor (const Real value)
template<typename Real>
constexpr Real lerp (const Real from, const Real to, const Real weight)
template<typename Real>
constexpr Real lerp_clamped (const Real from, const Real to, const Real weight)
template<typename Real>
Real sin (const Real value)
template<typename Real>
Real cos (const Real value)
template<typename Real>
Real tan (const Real value)
template<typename Real>
Real round (const Real value)
template<typename Real>
Real atan (const Real value)
template<typename Real>
Real atan2 (const Real y, const Real x)
template<typename Real>
constexpr Real radians (const Real degrees)
template<typename Real>
constexpr Real degrees (const Real radians)
template<typename Real>
Real asin (const Real value)
template<typename Real>
Real acos (const Real value)
template<typename Num>
constexpr Num min (const Num a, const Num b)
template<typename Num, typename... Rest>
constexpr Num min (const Num first, const Rest... rest)
template<typename Real>
Real log2 (const Real value)
template<typename Real>
Vector2< Real > constexpr operator* (const Real value, const Vector2< Real > &vector)
template<typename Real>
Vector2< Real > constexpr operator/ (const Real value, const Vector2< Real > &vector)
template<typename Int>
constexpr Vector2i< Int > operator* (const Int value, const Vector2i< Int > &vector)
template<typename Int>
constexpr Vector2i< Int > operator/ (const Int value, const Vector2i< Int > &vector)
template<typename Int>
constexpr Vector2i< Int > operator% (const Int value, const Vector2i< Int > &vector)
template<typename Real>
constexpr Vector3< Real > operator* (const Real value, const Vector3< Real > &vector)
template<typename Real>
constexpr Vector3< Real > operator/ (const Real value, const Vector3< Real > &vector)
template<typename Int>
constexpr Vector3i< Int > operator* (const Int value, const Vector3i< Int > &vector)
template<typename Int>
constexpr Vector3i< Int > operator/ (const Int value, const Vector3i< Int > &vector)
template<typename Int>
constexpr Vector3i< Int > operator% (const Int value, const Vector3i< Int > &vector)
template<typename Real>
constexpr Vector4< Real > operator* (const Real value, const Vector4< Real > &vector)
template<typename Real>
constexpr Vector4< Real > operator/ (const Real value, const Vector4< Real > &vector)
template<typename Real>
constexpr Matrix2< Real > operator* (const Real value, const Matrix2< Real > &matrix)
template<typename Real>
constexpr Matrix2< Real > operator/ (const Real value, const Matrix2< Real > &matrix)
template<typename Real>
constexpr Matrix3< Real > operator* (const Real value, const Matrix3< Real > &matrix)
template<typename Real>
constexpr Matrix3< Real > operator/ (const Real value, const Matrix3< Real > &matrix)
template<typename Real>
constexpr Matrix4< Real > operator* (const Real value, const Matrix4< Real > &matrix)
template<typename Real>
constexpr Matrix4< Real > operator/ (const Real value, const Matrix4< Real > &matrix)

Typedef Documentation

◆ Basis2d

using nnm::Basis2d = Basis2<double>

◆ Basis2f

using nnm::Basis2f = Basis2<float>

◆ Basis3d

using nnm::Basis3d = Basis3<double>

◆ Basis3f

using nnm::Basis3f = Basis3<float>

◆ Matrix2d

using nnm::Matrix2d = Matrix2<double>

◆ Matrix2f

using nnm::Matrix2f = Matrix2<float>

◆ Matrix3d

using nnm::Matrix3d = Matrix3<double>

◆ Matrix3f

using nnm::Matrix3f = Matrix3<float>

◆ Matrix4d

using nnm::Matrix4d = Matrix4<double>

◆ Matrix4f

using nnm::Matrix4f = Matrix4<float>

◆ QuaternionD

using nnm::QuaternionD = Quaternion<double>

◆ QuaternionF

using nnm::QuaternionF = Quaternion<float>

◆ Transform2d

using nnm::Transform2d = Transform2<double>

◆ Transform2f

using nnm::Transform2f = Transform2<float>

◆ Transform3d

using nnm::Transform3d = Transform3<double>

◆ Transform3f

using nnm::Transform3f = Transform3<float>

◆ Vector2d

using nnm::Vector2d = Vector2<double>

◆ Vector2f

using nnm::Vector2f = Vector2<float>

◆ Vector2i16

using nnm::Vector2i16 = Vector2i<int16_t>

◆ Vector2i32

using nnm::Vector2i32 = Vector2i<int32_t>

◆ Vector2i64

using nnm::Vector2i64 = Vector2i<int64_t>

◆ Vector2i8

using nnm::Vector2i8 = Vector2i<int8_t>

◆ Vector2ii

using nnm::Vector2ii = Vector2i<int>

◆ Vector2iu

using nnm::Vector2iu = Vector2i<unsigned int>

◆ Vector2u16

using nnm::Vector2u16 = Vector2i<uint16_t>

◆ Vector2u32

using nnm::Vector2u32 = Vector2i<uint32_t>

◆ Vector2u64

using nnm::Vector2u64 = Vector2i<uint64_t>

◆ Vector2u8

using nnm::Vector2u8 = Vector2i<uint8_t>

◆ Vector3d

using nnm::Vector3d = Vector3<double>

◆ Vector3f

using nnm::Vector3f = Vector3<float>

◆ Vector3i16

using nnm::Vector3i16 = Vector3i<int16_t>

◆ Vector3i32

using nnm::Vector3i32 = Vector3i<int32_t>

◆ Vector3i64

using nnm::Vector3i64 = Vector3i<int64_t>

◆ Vector3i8

using nnm::Vector3i8 = Vector3i<int8_t>

◆ Vector3ii

using nnm::Vector3ii = Vector3i<int>

◆ Vector3iu

using nnm::Vector3iu = Vector3i<unsigned int>

◆ Vector3u16

using nnm::Vector3u16 = Vector3i<uint16_t>

◆ Vector3u32

using nnm::Vector3u32 = Vector3i<uint32_t>

◆ Vector3u64

using nnm::Vector3u64 = Vector3i<uint64_t>

◆ Vector3u8

using nnm::Vector3u8 = Vector3i<uint8_t>

◆ Vector4d

using nnm::Vector4d = Vector4<double>

◆ Vector4f

using nnm::Vector4f = Vector4<float>

Function Documentation

◆ abs()

template<typename Num>
Num nnm::abs ( const Num value)
constexpr

Absolute value which is the number's distance from zero.

Template Parameters
NumNumeric type
Parameters
valueValue to take the absolute value of.
Returns
Result.

◆ acos()

template<typename Real>
Real nnm::acos ( const Real value)

Mathematical inverse cosine.

Template Parameters
RealFloating-point value.
Parameters
valueValue to take the inverse cosine of.
Returns
Resulting angle in radians.

◆ angle_in_range()

template<typename Real>
bool nnm::angle_in_range ( const Real angle,
const Real from,
const Real to )

Determines if an angle in radians is within a range taking into account wrap-around.

Template Parameters
RealFloating-point type.
Parameters
angleAngle to test in radians.
fromFirst angle in radians.
toSecond angle in radians
Returns
True if within range, false otherwise.

◆ approx_equal()

template<typename Real>
bool nnm::approx_equal ( const Real a,
const Real b )
constexpr

Determines if two values are approximately equal based on the epsilon value.

Template Parameters
RealFloating-point type.
Parameters
aFirst value.
bSecond value.
Returns
True if approximately equal or false otherwise.

◆ approx_greater()

template<typename Real>
bool nnm::approx_greater ( const Real a,
const Real b )
constexpr

Determine if the first value is approximately greater-than but not equal to the second value.

Template Parameters
RealFloating-point type.
Parameters
aFirst value.
bSecond value.
Returns
Result.

◆ approx_greater_equal()

template<typename Real>
bool nnm::approx_greater_equal ( const Real a,
const Real b )
constexpr

Determine if the first value is approximately greater-than or equal to the second value.

Template Parameters
RealFloating-point type.
Parameters
aFirst value.
bSecond value.
Returns
Result.

◆ approx_greater_equal_zero()

template<typename Real>
bool nnm::approx_greater_equal_zero ( const Real value)
constexpr

Determine if a value is approximately greater-than or equal to zero.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
Returns
Result.

◆ approx_greater_zero()

template<typename Real>
bool nnm::approx_greater_zero ( const Real value)
constexpr

Determine if a value is approximately greater-than but not equal to zero.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
Returns
Result.

◆ approx_less()

template<typename Real>
bool nnm::approx_less ( const Real a,
const Real b )
constexpr

Determine if the first value is approximately less-than but not equal to the second value.

Template Parameters
RealFloating-point type.
Parameters
aFirst value.
bSecond value.
Returns
Result.

◆ approx_less_equal()

template<typename Real>
bool nnm::approx_less_equal ( const Real a,
const Real b )
constexpr

Determine if the first value is approximately greater-than or equal to the second value.

Template Parameters
RealFloating-point type.
Parameters
aFirst value.
bSecond value.
Returns
Result.

◆ approx_less_equal_zero()

template<typename Real>
bool nnm::approx_less_equal_zero ( const Real value)
constexpr

Determine if a value is approximately less-than or equal to zero.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
Returns
Result.

◆ approx_less_zero()

template<typename Real>
bool nnm::approx_less_zero ( const Real value)
constexpr

Determine if a value is approximately less-than but not equal to zero.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
Returns
Result.

◆ approx_zero()

template<typename Real>
bool nnm::approx_zero ( const Real value)
constexpr

Determines if a value is approximately zero based on the epsilon value.

Template Parameters
RealFloating-point type.
Parameters
valueValue to test.
Returns
True if approximately zero or false otherwise.

◆ asin()

template<typename Real>
Real nnm::asin ( const Real value)

Mathematical inverse sine.

Template Parameters
RealFloating-point value.
Parameters
valueValue to take inverse sine of.
Returns
Resulting angle in radians.

◆ atan()

template<typename Real>
Real nnm::atan ( const Real value)

Mathematical inverse tangent.

Template Parameters
RealFloating-point value.
Parameters
valueValue to take inverse tangent of.
Returns
Result in radians.

◆ atan2()

template<typename Real>
Real nnm::atan2 ( const Real y,
const Real x )

Mathematical inverse tangent that takes into account all four-quadrants.

Template Parameters
RealFloating-point value.
Parameters
yY value.
xX value.
Returns
Result in radians.

◆ ceil()

template<typename Real>
Real nnm::ceil ( const Real value)

The least integer value greater than a value.

Template Parameters
RealFloating-point type.
Parameters
valueValue to take the ceiling of.
Returns
Result.

◆ clamp()

template<typename Num>
Num nnm::clamp ( const Num value,
const Num min,
const Num max )
constexpr

Restricts a value between a minimum and maximum range.

Template Parameters
NumNumeric type.
Parameters
valueValue to clamp.
minMinimum allowed value.
maxMaximum allowed value.
Returns
Result.

◆ cos()

template<typename Real>
Real nnm::cos ( const Real value)

Mathematical cosine.

Template Parameters
RealFloating-point value.
Parameters
valueValue to take the cosine of in radians.
Returns
Result.

◆ degrees()

template<typename Real>
Real nnm::degrees ( const Real radians)
constexpr

Converts angle in radians to degrees.

Template Parameters
RealFloating-point value.
Parameters
radiansAngle in radians.
Returns
Resulting angle in degrees.

◆ epsilon()

template<typename Real>
Real nnm::epsilon ( )
constexpr

Epsilon value is the upper bound on approximation errors.

Template Parameters
RealFloating-point type.
Returns
Epsilon value.

◆ floor()

template<typename Real>
Real nnm::floor ( const Real value)

The greatest integer value less or equal to a value.

Template Parameters
RealFloating-point type.
Parameters
valueValue to take the floor of.
Returns
Result.

◆ lerp()

template<typename Real>
Real nnm::lerp ( const Real from,
const Real to,
const Real weight )
constexpr

Linear interpolation between two values based on a weight value.

Template Parameters
RealFloating-point value.
Parameters
fromValue to interpolate from.
toValue to interpolate to.
weightValue that indicates interpolation between the two values normally between 0 and 1.
Returns
Result.

◆ lerp_clamped()

template<typename Real>
Real nnm::lerp_clamped ( const Real from,
const Real to,
const Real weight )
constexpr

Linear interpolation between two values based on a weight value that is clamped between 0 and 1.

Template Parameters
RealFloating-point value.
Parameters
fromValue to interpolate from.
toValue to interpolate to.
weightValue that indicates interpolation between the two values that is clamped between 0 and 1.
Returns
Result.

◆ log2()

template<typename Real>
Real nnm::log2 ( const Real value)

Binary logarithm of a value which is the power to which the number 2 must be raised to obtain the value.

Template Parameters
RealFloating-point value.
Parameters
valueValue to take logarithm of.
Returns
Result.

◆ max() [1/2]

template<typename Num>
Num nnm::max ( const Num a,
const Num b )
constexpr

The maximum between two values.

Template Parameters
NumNumeric type.
Parameters
aFirst value.
bSecond value.
Returns
Result.

◆ max() [2/2]

template<typename Num, typename... Rest>
Num nnm::max ( const Num first,
const Rest... rest )
constexpr

The maximum between values.

Template Parameters
NumNumeric type.
RestNumeric types.
Parameters
firstFirst value.
restRest of the values.
Returns
Result.

◆ min() [1/2]

template<typename Num>
Num nnm::min ( const Num a,
const Num b )
constexpr

The minimum value between two values.

Template Parameters
NumNumeric type.
Parameters
aFirst value.
bSecond value.
Returns
Result.

◆ min() [2/2]

template<typename Num, typename... Rest>
Num nnm::min ( const Num first,
const Rest... rest )
constexpr

The minimum between values.

Template Parameters
NumNumeric type.
RestNumeric types.
Parameters
firstFirst value.
restRest of the values.
Returns
Result.

◆ mod()

template<typename Int>
Int nnm::mod ( const Int dividend,
const Int divisor )
constexpr

Integer mathematical modulus where the result is always positive.

Template Parameters
IntInteger type.
Parameters
dividendDividend.
divisorDivisor.
Returns
Result.

◆ modf()

template<typename Real>
Real nnm::modf ( const Real dividend,
const Real divisor )

Floating-point mathematical modulus where the result is always positive.

Template Parameters
RealFloating-point type.
Parameters
dividendDividend.
divisorDivisor.
Returns
Result.

◆ normalize_angle()

template<typename Real>
Real nnm::normalize_angle ( const Real angle)

Normalizes an angle in radians between -pi and pi.

Template Parameters
RealFloating-point type.
Parameters
angleAngle to normalize in radians.
Returns
Result.

◆ operator%() [1/2]

template<typename Int>
Vector2i< Int > nnm::operator% ( const Int value,
const Vector2i< Int > & vector )
constexpr

Component-wise remainder with value.

Template Parameters
IntInteger type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator%() [2/2]

template<typename Int>
Vector3i< Int > nnm::operator% ( const Int value,
const Vector3i< Int > & vector )
constexpr

Component-wise remainder with value.

Template Parameters
IntInteger type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator*() [1/8]

template<typename Int>
Vector2i< Int > nnm::operator* ( const Int value,
const Vector2i< Int > & vector )
constexpr

Component-wise multiplication with value.

Template Parameters
IntInteger type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator*() [2/8]

template<typename Int>
Vector3i< Int > nnm::operator* ( const Int value,
const Vector3i< Int > & vector )
constexpr

Component-wise multiplication with value.

Template Parameters
IntInteger type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator*() [3/8]

template<typename Real>
Matrix2< Real > nnm::operator* ( const Real value,
const Matrix2< Real > & matrix )
constexpr

Element-wise multiplication with value.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
matrixMatrix.
Returns
Result.

◆ operator*() [4/8]

template<typename Real>
Matrix3< Real > nnm::operator* ( const Real value,
const Matrix3< Real > & matrix )
constexpr

Element-wise multiplication with value.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
matrixMatrix.
Returns
Result.

◆ operator*() [5/8]

template<typename Real>
Matrix4< Real > nnm::operator* ( const Real value,
const Matrix4< Real > & matrix )
constexpr

Scalar-matrix multiplication.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
matrixMatrix.
Returns
Result.

◆ operator*() [6/8]

template<typename Real>
Vector2< Real > constexpr nnm::operator* ( const Real value,
const Vector2< Real > & vector )
constexpr

Scalar-vector multiplication.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator*() [7/8]

template<typename Real>
Vector3< Real > nnm::operator* ( const Real value,
const Vector3< Real > & vector )
constexpr

Component-wise multiplication with value.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator*() [8/8]

template<typename Real>
Vector4< Real > nnm::operator* ( const Real value,
const Vector4< Real > & vector )
constexpr

Component-wise multiplication with value.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator/() [1/8]

template<typename Int>
Vector2i< Int > nnm::operator/ ( const Int value,
const Vector2i< Int > & vector )
constexpr

Component-wise division with value.

Template Parameters
IntInteger type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator/() [2/8]

template<typename Int>
Vector3i< Int > nnm::operator/ ( const Int value,
const Vector3i< Int > & vector )
constexpr

Component-wise division with value.

Template Parameters
IntInteger type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator/() [3/8]

template<typename Real>
Matrix2< Real > nnm::operator/ ( const Real value,
const Matrix2< Real > & matrix )
constexpr

Element-wise division with value.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
matrixMatrix.
Returns
Result.

◆ operator/() [4/8]

template<typename Real>
Matrix3< Real > nnm::operator/ ( const Real value,
const Matrix3< Real > & matrix )
constexpr

Element-wise division with value.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
matrixMatrix.
Returns
Result.

◆ operator/() [5/8]

template<typename Real>
Matrix4< Real > nnm::operator/ ( const Real value,
const Matrix4< Real > & matrix )
constexpr

Element-wise division by value.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
matrixMatrix.
Returns
Result.

◆ operator/() [6/8]

template<typename Real>
Vector2< Real > constexpr nnm::operator/ ( const Real value,
const Vector2< Real > & vector )
constexpr

Scalar-vector division.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator/() [7/8]

template<typename Real>
Vector3< Real > nnm::operator/ ( const Real value,
const Vector3< Real > & vector )
constexpr

Component-wise division with value.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ operator/() [8/8]

template<typename Real>
Vector4< Real > nnm::operator/ ( const Real value,
const Vector4< Real > & vector )
constexpr

Component-wise division with value.

Template Parameters
RealFloating-point type.
Parameters
valueValue.
vectorVector.
Returns
Result.

◆ pi()

template<typename Real>
Real nnm::pi ( )
constexpr

Mathematical pi.

Template Parameters
RealFloating-point type.
Returns
Mathematical pi.

◆ pow()

template<typename Real>
Real nnm::pow ( const Real base,
const Real power )

Exponential operation between two values.

Template Parameters
RealFloating-point type.
Parameters
baseBase value.
powerPower value.
Returns
Result.

◆ radians()

template<typename Real>
Real nnm::radians ( const Real degrees)
constexpr

Converts angle in degrees to radians.

Template Parameters
RealFloating-point value.
Parameters
degreesAngle in degrees.
Returns
Resulting angle in radians.

◆ rem()

template<typename Int>
Int nnm::rem ( const Int dividend,
const Int divisor )
constexpr

Remainder of the division between two integer values.

Template Parameters
IntInteger type.
Parameters
dividendDividend.
divisorDivisor.
Returns
Result.

◆ remf()

template<typename Real>
Real nnm::remf ( const Real dividend,
const Real divisor )

Remainder of the division between two floating-point values.

Template Parameters
RealFloating-point type
Parameters
dividendDividend.
divisorDivisor.
Returns
Result.

◆ round()

template<typename Real>
Real nnm::round ( const Real value)

Rounds a value to the nearest integer value.

Template Parameters
RealFloating-point value.
Parameters
valueValue to round.
Returns
Result.

◆ sign()

template<typename Num>
Num nnm::sign ( const Num value)
constexpr

One multiplied by the sign of a value.

Template Parameters
NumNumeric type.
Parameters
valueValue to get the sign of.
Returns
-1 for negatives and 1 for 0 or positive.

◆ sin()

template<typename Real>
Real nnm::sin ( const Real value)

Mathematical sine of a value

Template Parameters
RealFloating-point type.
Parameters
valueValue to take the sine of in radians.
Returns
Result.

◆ sqrd()

template<typename Num>
Num nnm::sqrd ( const Num value)
constexpr

Square of a value.

Template Parameters
NumNumeric type.
Parameters
valueValue to square.
Returns
Result.

◆ sqrt()

template<typename Real>
Real nnm::sqrt ( const Real value)

Square-root of a value.

Template Parameters
RealFloating-point type.
Parameters
valueValue to square-root.
Returns
Result.

◆ tan()

template<typename Real>
Real nnm::tan ( const Real value)

Mathematical tangent.

Template Parameters
RealFloating-point value.
Parameters
valueValue to take the tangent of in radians.
Returns
Result.