Bond 0.9
Bond Standard Library API Documentation
Loading...
Searching...
No Matches
math.bond

A collection of functions and constants for performing math operations. More...

Functions

double Bond::Sin (double x)
 Returns the sine of an angle in radians.
float Bond::Sinf (float x)
 Returns the sine of an angle in radians.
double Bond::Cos (double x)
 Returns the cosine of an angle in radians.
float Bond::Cosf (float x)
 Returns the cosine of an angle in radians.
double Bond::Tan (double x)
 Returns the tangent of an angle in radians.
float Bond::Tanf (float x)
 Returns the tangent of an angle in radians.
double Bond::Asin (double x)
 Returns the arcsine in radians of a value.
float Bond::Asinf (float x)
 Returns the arcsine in radians of a value.
double Bond::Acos (double x)
 Returns the arccosine in radians of a value.
float Bond::Acosf (float x)
 Returns the arccosine in radians of a value.
double Bond::Atan (double x)
 Returns the arctangent in radians of a value.
float Bond::Atanf (float x)
 Returns the arctangent in radians of a value.
double Bond::Atan2 (double y, double x)
 Returns the arctangent in radians of y/x.
float Bond::Atan2f (float y, float x)
 Returns the arctangent in radians of y/x.
double Bond::Sinh (double x)
 Returns the hyperbolic sine of a hyperbolic angle.
float Bond::Sinhf (float x)
 Returns the hyperbolic sine of a hyperbolic angle.
double Bond::Cosh (double x)
 Returns the hyperbolic cosine of a hyperbolic angle.
double Bond::Coshf (float x)
 Returns the hyperbolic cosine of a hyperbolic angle.
double Bond::Tanh (double x)
 Returns the hyperbolic tangent of a hyperbolic angle.
float Bond::Tanhf (float x)
 Returns the hyperbolic tangent of a hyperbolic angle.
double Bond::Asinh (double x)
 Returns the inverse hyperbolic sine of a value.
float Bond::Asinhf (float x)
 Returns the inverse hyperbolic sine of a value.
double Bond::Acosh (double x)
 Returns the inverse hyperbolic cosine of a value.
float Bond::Acoshf (float x)
 Returns the inverse hyperbolic cosine of a value.
double Bond::Atanh (double x)
 Returns the inverse hyperbolic tangent of a value.
float Bond::Atanhf (float x)
 Returns the inverse hyperbolic tangent of a value.
double Bond::Exp (double x)
 Returns e raised to an exponent.
float Bond::Expf (float x)
 Returns e raised to an exponent.
double Bond::Exp2 (double x)
 Returns 2 raised to an exponent.
float Bond::Exp2f (float x)
 Returns 2 raised to an exponent.
double Bond::Log (double x)
 Returns the natural logarithm of a value.
float Bond::Logf (float x)
 Returns the natural logarithm of a value.
double Bond::Log2 (double x)
 Returns the base-2 logarithm of a value.
float Bond::Log2f (float x)
 Returns the base-2 logarithm of a value.
double Bond::Log10 (double x)
 Returns the base-10 logarithm of a value.
float Bond::Log10f (float x)
 Returns the base-10 logarithm of a value.
double Bond::Pow (double base, double exponent)
 Returns a base value raised to an exponent.
float Bond::Powf (float base, float exponent)
 Returns a base value raised to an exponent.
double Bond::Sqrt (double x)
 Returns the square root of a value.
float Bond::Sqrtf (float x)
 Returns the square root of a value.
double Bond::Cbrt (double x)
 Returns the cube root of a value.
float Bond::Cbrtf (float x)
 Returns the cube root of a value.
double Bond::Hypot (double x, double y)
 Returns the hypotenuse of a right-angled triangle with sides of the given lengths.
float Bond::Hypotf (float x, float y)
 Returns the hypotenuse of a right-angled triangle with sides of the given lengths.
double Bond::Ceil (double x)
 Returns a value rounded upward.
float Bond::Ceilf (float x)
 Returns a value rounded upward.
double Bond::Floor (double x)
 Returns a value rounded downward.
float Bond::Floorf (float x)
 Returns a value rounded downward.
double Bond::Trunc (double x)
 Returns a value rounded toward zero.
float Bond::Truncf (float x)
 Returns a value rounded toward zero.
double Bond::Fabs (double x)
 Returns the absolute value of a value.
float Bond::Fabsf (float x)
 Returns the absolute value of a value.
double Bond::Ldexp (double x, int exp)
 Returns a value multiplied by 2 raised to an exponent.
float Bond::Ldexpf (float x, int exp)
 Returns a value multiplied by 2 raised to an exponent.
double Bond::Frexp (double x, int *exp)
 Decomposes a value into a fraction and an integral power of two.
float Bond::Frexpf (float x, int *exp)
 Decomposes a value into a fraction and an integral power of two.
double Bond::Modf (double x, double *ip)
 Decomposes a value into its integral and fractional parts.
float Bond::Modff (float x, float *ip)
 Decomposes a value into its integral and fractional parts.
double Bond::Fmod (double x, double y)
 Returns the remainder of x/y rounded toward zero.
float Bond::Fmodf (float x, float y)
 Returns the remainder of x/y rounded toward zero.
double Bond::CopySign (double x, double y)
 Returns a value with the magnitude of one and the sign of another.
float Bond::CopySignf (float x, float y)
 Returns a value with the magnitude of one and the sign of another.
double Bond::NaN ()
 Returns a value representing Not-a-Number.
float Bond::NaNf ()
 Returns a value representing Not-a-Number.

Variables

const double Bond::PI = 3.14159265358979323846
 The value of pi as a double.
const float Bond::PI_F = cast<float>(PI)
 The value of pi as a float.
const double Bond::HALF_PI = PI / 2.0
 The value of pi/2 as a double.
const float Bond::HALF_PI_F = cast<float>(HALF_PI)
 The value of pi/2 as a float.
const double Bond::TWO_PI = PI * 2.0
 The value of 2pi as a double.
const float Bond::TWO_PI_F = cast<float>(TWO_PI)
 The value of 2pi as a float.

Detailed Description

A collection of functions and constants for performing math operations.

include "math.bond";

Function Documentation

◆ Acos()

double Bond::Acos ( double x)

Returns the arccosine in radians of a value.

Parameters
xA value in the range [-1, +1] whose arccosine is calculated.

◆ Acosf()

float Bond::Acosf ( float x)

Returns the arccosine in radians of a value.

Parameters
xA value in the range [-1, +1] whose arccosine is calculated.

◆ Acosh()

double Bond::Acosh ( double x)

Returns the inverse hyperbolic cosine of a value.

Parameters
xThe value whose inverse hyperbolic cosine is calculated.

◆ Acoshf()

float Bond::Acoshf ( float x)

Returns the inverse hyperbolic cosine of a value.

Parameters
xThe value whose inverse hyperbolic cosine is calculated.

◆ Asin()

double Bond::Asin ( double x)

Returns the arcsine in radians of a value.

Parameters
xA value in the range [-1, +1] whose arcsine is calculated.

◆ Asinf()

float Bond::Asinf ( float x)

Returns the arcsine in radians of a value.

Parameters
xA value in the range [-1, +1] whose arcsine is calculated.

◆ Asinh()

double Bond::Asinh ( double x)

Returns the inverse hyperbolic sine of a value.

Parameters
xThe value whose inverse hyperbolic sine is calculated.

◆ Asinhf()

float Bond::Asinhf ( float x)

Returns the inverse hyperbolic sine of a value.

Parameters
xThe value whose inverse hyperbolic sine is calculated.

◆ Atan()

double Bond::Atan ( double x)

Returns the arctangent in radians of a value.

Parameters
xA value in the range [-1, +1] whose arctangent is calculated.

◆ Atan2()

double Bond::Atan2 ( double y,
double x )

Returns the arctangent in radians of y/x.

Parameters
yThe coordinate on the Y axis.
xThe coordinate on the X axis.

◆ Atan2f()

float Bond::Atan2f ( float y,
float x )

Returns the arctangent in radians of y/x.

Parameters
yThe coordinate on the Y axis.
xThe coordinate on the X axis.

◆ Atanf()

float Bond::Atanf ( float x)

Returns the arctangent in radians of a value.

Parameters
xA value in the range [-1, +1] whose arctangent is calculated.

◆ Atanh()

double Bond::Atanh ( double x)

Returns the inverse hyperbolic tangent of a value.

Parameters
xThe value whose inverse hyperbolic tangent is calculated.

◆ Atanhf()

float Bond::Atanhf ( float x)

Returns the inverse hyperbolic tangent of a value.

Parameters
xThe value whose inverse hyperbolic tangent is calculated.

◆ Cbrt()

double Bond::Cbrt ( double x)

Returns the cube root of a value.

Parameters
xThe value whose square root is calculated.

◆ Cbrtf()

float Bond::Cbrtf ( float x)

Returns the cube root of a value.

Parameters
xThe value whose square root is calculated.

◆ Ceil()

double Bond::Ceil ( double x)

Returns a value rounded upward.

Parameters
xThe value to be rounded.

◆ Ceilf()

float Bond::Ceilf ( float x)

Returns a value rounded upward.

Parameters
xThe value to be rounded.

◆ CopySign()

double Bond::CopySign ( double x,
double y )

Returns a value with the magnitude of one and the sign of another.

Parameters
xThe value whose magnitude is returned.
yThe value whose sign is returned.

◆ CopySignf()

float Bond::CopySignf ( float x,
float y )

Returns a value with the magnitude of one and the sign of another.

Parameters
xThe value whose magnitude is returned.
yThe value whose sign is returned.

◆ Cos()

double Bond::Cos ( double x)

Returns the cosine of an angle in radians.

Parameters
xAn angle expressed in radians.

◆ Cosf()

float Bond::Cosf ( float x)

Returns the cosine of an angle in radians.

Parameters
xAn angle expressed in radians.

◆ Cosh()

double Bond::Cosh ( double x)

Returns the hyperbolic cosine of a hyperbolic angle.

Parameters
xA hyperbolic angle whose hyperbolic cosine is calculated.

◆ Coshf()

double Bond::Coshf ( float x)

Returns the hyperbolic cosine of a hyperbolic angle.

Parameters
xA hyperbolic angle whose hyperbolic cosine is calculated.

◆ Exp()

double Bond::Exp ( double x)

Returns e raised to an exponent.

Parameters
xThe value of the exponent.

◆ Exp2()

double Bond::Exp2 ( double x)

Returns 2 raised to an exponent.

Parameters
xThe value of the exponent.

◆ Exp2f()

float Bond::Exp2f ( float x)

Returns 2 raised to an exponent.

Parameters
xThe value of the exponent.

◆ Expf()

float Bond::Expf ( float x)

Returns e raised to an exponent.

Parameters
xThe value of the exponent.

◆ Fabs()

double Bond::Fabs ( double x)

Returns the absolute value of a value.

Parameters
xThe value whose absolute value is calculated.

◆ Fabsf()

float Bond::Fabsf ( float x)

Returns the absolute value of a value.

Parameters
xThe value whose absolute value is calculated.

◆ Floor()

double Bond::Floor ( double x)

Returns a value rounded downward.

Parameters
xThe value to be rounded.

◆ Floorf()

float Bond::Floorf ( float x)

Returns a value rounded downward.

Parameters
xThe value to be rounded.

◆ Fmod()

double Bond::Fmod ( double x,
double y )

Returns the remainder of x/y rounded toward zero.

Parameters
xThe numerator of the division operation.
yThe denominator of the division operation.

◆ Fmodf()

float Bond::Fmodf ( float x,
float y )

Returns the remainder of x/y rounded toward zero.

Parameters
xThe numerator of the division operation.
yThe denominator of the division operation.

◆ Frexp()

double Bond::Frexp ( double x,
int * exp )

Decomposes a value into a fraction and an integral power of two.

Parameters
xThe value that is decomposed.
expA pointer to an int where the exponent is stored.
Returns
A value whose absolute value is in the range [0.5, 1.0), which, when multiplied by 2 to the power of exp, results in x.

◆ Frexpf()

float Bond::Frexpf ( float x,
int * exp )

Decomposes a value into a fraction and an integral power of two.

Parameters
xThe value that is decomposed.
expA pointer to an int where the exponent is stored.
Returns
A value whose absolute value is in the range [0.5, 1.0), which, when multiplied by 2 to the power of exp, results in x.

◆ Hypot()

double Bond::Hypot ( double x,
double y )

Returns the hypotenuse of a right-angled triangle with sides of the given lengths.

Parameters
xThe length of the first side of the triangle.
yThe length of the second side of the triangle.

◆ Hypotf()

float Bond::Hypotf ( float x,
float y )

Returns the hypotenuse of a right-angled triangle with sides of the given lengths.

Parameters
xThe length of the first side of the triangle.
yThe length of the second side of the triangle.

◆ Ldexp()

double Bond::Ldexp ( double x,
int exp )

Returns a value multiplied by 2 raised to an exponent.

Parameters
xThe value that is multiplied by 2 raised to an exponent.
expThe exponent.

◆ Ldexpf()

float Bond::Ldexpf ( float x,
int exp )

Returns a value multiplied by 2 raised to an exponent.

Parameters
xThe value that is multiplied by 2 raised to an exponent.
expThe exponent.

◆ Log()

double Bond::Log ( double x)

Returns the natural logarithm of a value.

Parameters
xThe value whose natural logarithm is calculated.

◆ Log10()

double Bond::Log10 ( double x)

Returns the base-10 logarithm of a value.

Parameters
xThe value whose logarithm is calculated.

◆ Log10f()

float Bond::Log10f ( float x)

Returns the base-10 logarithm of a value.

Parameters
xThe value whose logarithm is calculated.

◆ Log2()

double Bond::Log2 ( double x)

Returns the base-2 logarithm of a value.

Parameters
xThe value whose logarithm is calculated.

◆ Log2f()

float Bond::Log2f ( float x)

Returns the base-2 logarithm of a value.

Parameters
xThe value whose logarithm is calculated.

◆ Logf()

float Bond::Logf ( float x)

Returns the natural logarithm of a value.

Parameters
xThe value whose natural logarithm is calculated.

◆ Modf()

double Bond::Modf ( double x,
double * ip )

Decomposes a value into its integral and fractional parts.

Parameters
xThe value that is decomposed.
ipA pointer to a double where the integral part is stored.
Returns
The fractional part, which, when added to ip, results in x.

◆ Modff()

float Bond::Modff ( float x,
float * ip )

Decomposes a value into its integral and fractional parts.

Parameters
xThe value that is decomposed.
ipA pointer to a float where the integral part is stored.
Returns
The fractional part, which, when added to ip, results in x.

◆ NaN()

double Bond::NaN ( )

Returns a value representing Not-a-Number.

◆ NaNf()

float Bond::NaNf ( )

Returns a value representing Not-a-Number.

◆ Pow()

double Bond::Pow ( double base,
double exponent )

Returns a base value raised to an exponent.

Parameters
baseThe value of the base.
exponentThe value of the exponent.

◆ Powf()

float Bond::Powf ( float base,
float exponent )

Returns a base value raised to an exponent.

Parameters
baseThe value of the base.
exponentThe value of the exponent.

◆ Sin()

double Bond::Sin ( double x)

Returns the sine of an angle in radians.

Parameters
xAn angle expressed in radians.

◆ Sinf()

float Bond::Sinf ( float x)

Returns the sine of an angle in radians.

Parameters
xAn angle expressed in radians.

◆ Sinh()

double Bond::Sinh ( double x)

Returns the hyperbolic sine of a hyperbolic angle.

Parameters
xA hyperbolic angle whose hyperbolic sine is calculated.

◆ Sinhf()

float Bond::Sinhf ( float x)

Returns the hyperbolic sine of a hyperbolic angle.

Parameters
xA hyperbolic angle whose hyperbolic sine is calculated.

◆ Sqrt()

double Bond::Sqrt ( double x)

Returns the square root of a value.

Parameters
xThe value whose square root is calculated.

◆ Sqrtf()

float Bond::Sqrtf ( float x)

Returns the square root of a value.

Parameters
xThe value whose square root is calculated.

◆ Tan()

double Bond::Tan ( double x)

Returns the tangent of an angle in radians.

Parameters
xAn angle expressed in radians.

◆ Tanf()

float Bond::Tanf ( float x)

Returns the tangent of an angle in radians.

Parameters
xAn angle expressed in radians.

◆ Tanh()

double Bond::Tanh ( double x)

Returns the hyperbolic tangent of a hyperbolic angle.

Parameters
xA hyperbolic angle whose hyperbolic tangent is calculated.

◆ Tanhf()

float Bond::Tanhf ( float x)

Returns the hyperbolic tangent of a hyperbolic angle.

Parameters
xA hyperbolic angle whose hyperbolic tangent is calculated.

◆ Trunc()

double Bond::Trunc ( double x)

Returns a value rounded toward zero.

Parameters
xThe value to be rounded.

◆ Truncf()

float Bond::Truncf ( float x)

Returns a value rounded toward zero.

Parameters
xThe value to be rounded.

Variable Documentation

◆ HALF_PI

const double Bond::HALF_PI = PI / 2.0

The value of pi/2 as a double.

◆ HALF_PI_F

const float Bond::HALF_PI_F = cast<float>(HALF_PI)

The value of pi/2 as a float.

◆ PI

const double Bond::PI = 3.14159265358979323846

The value of pi as a double.

◆ PI_F

const float Bond::PI_F = cast<float>(PI)

The value of pi as a float.

◆ TWO_PI

const double Bond::TWO_PI = PI * 2.0

The value of 2pi as a double.

◆ TWO_PI_F

const float Bond::TWO_PI_F = cast<float>(TWO_PI)

The value of 2pi as a float.