sincerely Singaporean

If you have not done so, read this full tutorial on how to use SGEXTN to build an application.

SGLFloatMath

see header file

see source file

class SGLFloatMath;

part of SGEXTN module SG_Math

static function class providing floating point mathematical operations

detailed description

list of all including inherited members

implementation details

preprocessor file inclusion directive: #include ‹SGLFloatMath.h›

CMake target for BuildLah: SGEXTN::SG_Math

see this link for more information about BuildLah

parent class: (none)

children classes: (none)

static member functions

static float aToThePowerOfB(float a, float b);

static float absoluteValue(float x);

static float arccosine(float x);

static float arcsine(float x);

static float arctangent(float x);

static float arctangentQuadrantAware(float y, float x);

static float ceiling(float x);

static int ceilingToInt(float x);

static long long ceilingToLongLong(float x);

static float cosecant(float x);

static float cosine(float x);

static float cotangent(float x);

static float cubeRoot(float x);

static float eToThePowerOfThis(float x);

static float extendedFactorial(float x);

static float floor(float x);

static int floorToInt(float x);

static long long floorToLongLong(float x);

static float integralOfNormalDistributionFromLeft(float x);

static float integralOfNormalDistributionFromRight(float x);

static float logarithmBase10(float x);

static float logarithmBase2(float x);

static float maximum(float a, float b);

static float minimum(float a, float b);

static float modulo(float a, float b);

static float naturalLogarithm(float x);

static float round(float x);

static int roundToInt(float x);

static long long roundToLongLong(float x);

static float secant(float x);

static float sine(float x);

static float squareRoot(float x);

static float tangent(float x);

static float twoToThePowerOfThis(float x);

Detailed Description

SGLFloatMath provides mathematical functions for floating point numbers including logarithm, square root, and factorial (gamma).

Implementation Details

Uses ‹cmath› from Standard Template Library

static float aToThePowerOfB(float a, float b);

Returns a^b.

For negative b, the behaviour follows whatever is defined by the Standard Template Library.

static float absoluteValue(float x);

Returns absolute value of x.

static float arccosine(float x);

Returns the angle in radians, the cosine of which is x.

For x less than -1 or more than 1, the behaviour follows whatever is defined by the Standard Template Library.

Multiply by 180 / pi to convert from radians to degrees.

This is the inverse function of cosine.

static float arcsine(float x);

Returns the angle in radians, the sine of which is x.

For x less than -1 or more than 1, the behaviour follows whatever is defined by the Standard Template Library.

Multiply by 180 / pi to convert from radians to degrees.

This is the inverse function of sine.

static float arctangent(float x);

Returns the angle in radians, the tangent of which is x.

Multiply by 180 / pi to convert from radians to degrees.

This is the inverse function of tangent.

static float arctangentQuadrantAware(float y, float x);

Returns the angle in radians such that rotating (1, 0) by that angle around the origin counterclockwise gives the point (k * x, k * y) where k is positive.

Multiply by 180 / pi to convert from radians to degrees.

static float ceiling(float x);

Returns x rounded up to the nearest integer.

static int ceilingToInt(float x);

Returns x rounded up to the nearest integer.

static long long ceilingToLongLong(float x);

Returns x rounded up to the nearest integer.

static float cosecant(float x);

Returns the cosecant of a x radians angle.

Multiply by pi / 180 to convert degrees to radians.

This is the reciprocal function of sine.

static float cosine(float x);

Returns the cosine of a x radians angle.

Multiply by pi / 180 to convert degrees to radians.

static float cotangent(float x);

Returns the cotangent of a x radians angle.

Multiply by pi / 180 to convert degrees to radians.

This is the reciprocal function of tangent.

static float cubeRoot(float x);

Returns cbrt(x).

For negative x, the behaviour follows whatever is defined by the Standard Template Library.

static float eToThePowerOfThis(float x);

Returns e^x where e is Euler's Number.

static float extendedFactorial(float x);

Returns the extended factorial (gamma function) of x.

static float floor(float x);

Returns x rounded down to the nearest integer.

static int floorToInt(float x);

Returns x rounded down to the nearest integer.

static long long floorToLongLong(float x);

Returns x rounded down to the nearest integer.

static float integralOfNormalDistributionFromLeft(float x);

Returns the integral of a normal distribution from negative infinity to x.

static float integralOfNormalDistributionFromRight(float x);

Returns the integral of a normal distribution from x to positive infinity.

static float logarithmBase10(float x);

Returns the base 10 logarithm of x.

For negative x, the behaviour follows whatever is defined by the Standard Template Library.

static float logarithmBase2(float x);

Returns the base 2 logarithm of x.

For negative x, the behaviour follows whatever is defined by the Standard Template Library.

static float maximum(float a, float b);

Returns maximum of a and b.

static float minimum(float a, float b);

Returns minimum of a and b.

static float modulo(float a, float b);

Returns remainder of a when divided by b.

static float naturalLogarithm(float x);

Returns ln(x).

For negative x, the behaviour follows whatever is defined by the Standard Template Library.

static float round(float x);

Returns x rounded to the nearest integer.

static int roundToInt(float x);

Returns x rounded to the nearest integer.

static long long roundToLongLong(float x);

Returns x rounded to the nearest integer.

static float secant(float x);

Returns the secant of a x radians angle.

Multiply by pi / 180 to convert degrees to radians.

This is the reciprocal function of cosine.

static float sine(float x);

Returns the sine of a x radians angle.

Multiply by pi / 180 to convert degrees to radians.

static float squareRoot(float x);

Returns sqrt(x).

For negative x, the behaviour follows whatever is defined by the Standard Template Library.

static float tangent(float x);

Returns the tangent of a x radians angle.

Multiply by pi / 180 to convert degrees to radians.

static float twoToThePowerOfThis(float x);

Returns 2^x.

©2025 05524F.sg (Singapore)

contact 05524F / report a bug / make a suggestion

about 05524F SINGAPORE values

list of 05524F projects