tango.math.Math

Members

Functions

abs
real abs(real x)
long abs(long x)
int abs(int x)
real abs(creal z)
real abs(ireal y)

Calculates the absolute value

acos
real acos(real x)

Calculates the arc cosine of x, returning a value ranging from 0 to π.

acos
creal acos(creal z)

Complex inverse cosine

acosh
real acosh(real x)

Calculates the inverse hyperbolic cosine of x.

asin
real asin(real x)

Calculates the arc sine of x, returning a value ranging from -π/2 to π/2.

asin
creal asin(creal z)

Complex inverse sine

asinh
real asinh(real x)

Calculates the inverse hyperbolic sine of x.

atan
real atan(real x)

Calculates the arc tangent of x, returning a value ranging from -π/2 to π/2.

atan2
real atan2(real y, real x)

Calculates the arc tangent of y / x, returning a value ranging from -π to π.

atanPi
real atanPi(real x)

Sine, cosine, and arctangent of multiple of π

atanh
real atanh(real x)
creal atanh(ireal y)
creal atanh(creal z)

Calculates the inverse hyperbolic tangent of x, returning a value from ranging from -1 to 1.

cbrt
real cbrt(real x)

Calculates the cube root of x.

ceil
real ceil(real x)

Returns the value of x rounded upward to the next integer (toward positive infinity).

conj
creal conj(creal z)
ireal conj(ireal y)

Complex conjugate

cos
real cos(real x)

Returns cosine of x. x is in radians.

cos
creal cos(creal z)
real cos(ireal y)

cosine, complex and imaginary

cosPi
real cosPi(real x)

Sine, cosine, and arctangent of multiple of π

cosh
real cosh(real x)

Calculates the hyperbolic cosine of x.

cosh
creal cosh(creal z)
real cosh(ireal y)

hyperbolic cosine, complex and imaginary

exp
real exp(real x)

Calculates e$(SUP x).

exp
creal exp(ireal y)
creal exp(creal z)

Exponential, complex and imaginary

exp2
real exp2(real x)

Calculates 2$(SUP x).

expm1
real expm1(real x)

Calculates the value of the natural logarithm base (e) raised to the power of x, minus 1.

feq
deprecated bool feq(XReal x, YReal y)

Floating point "approximate equality".

floor
real floor(real x)

Returns the value of x rounded downward to the next integer (toward negative infinity).

hypot
real hypot(real x, real y)

Calculates the length of the hypotenuse of a right-angled triangle with sides of length x and y. The hypotenuse is the value of the square root of the sums of the squares of x and y:

log
real log(real x)

Calculate the natural logarithm of x.

log
creal log(creal z)

Natural logarithm, complex

log10
real log10(real x)

Calculate the base-10 logarithm of x.

log1p
real log1p(real x)

Calculates the natural logarithm of 1 + x.

log2
real log2(real x)

Calculates the base-2 logarithm of x: log2x

max
minmaxtype!(T) max(T arg)

Return the maximum of the supplied arguments.

maxNaN
real maxNaN(real x, real y)

Returns the maximum of x and y, favouring NaNs over numbers

maxNum
real maxNum(real x, real y)

Returns the maximum number of x and y, favouring numbers over NaNs.

min
minmaxtype!(T) min(T arg)

Return the minimum of the supplied arguments.

minNaN
real minNaN(real x, real y)

Returns the minimum of x and y, favouring NaNs over numbers

minNum
real minNum(real x, real y)

Returns the minimum number of x and y, favouring numbers over NaNs.

poly
T poly(T x, const(T[]) A)

Evaluate polynomial A(x) = a0 + a1x + a2x2 + a3x3; ...

pow
real pow(real x, uint n)
real pow(real x, int n)

Fast integral powers.

pow
real pow(real x, real y)

Calculates x$(SUP y).

rationalPoly
T rationalPoly(T x, const(T[]) numerator, const(T[]) denominator)
Undocumented in source. Be warned that the author may not have intended to support it.
rndint
int rndint(real x)
rndlong
long rndlong(real x)

Rounds x to the nearest int or long.

round
real round(real x)

Return the value of x rounded to the nearest integer. If the fractional part of x is exactly 0.5, the return value is rounded to the even integer.

sin
real sin(real x)

Returns sine of x. x is in radians.

sin
creal sin(creal z)
ireal sin(ireal y)

sine, complex and imaginary

sinPi
real sinPi(real x)

Sine, cosine, and arctangent of multiple of π

sinh
real sinh(real x)

Calculates the hyperbolic sine of x.

sinh
creal sinh(creal z)
ireal sinh(ireal y)

hyperbolic sine, complex and imaginary

sqrt
float sqrt(float x)

Compute square root of x.

sqrt
double sqrt(double x)
Undocumented in source. Be warned that the author may not have intended to support it.
sqrt
real sqrt(real x)
Undocumented in source. Be warned that the author may not have intended to support it.
sqrt
creal sqrt(creal z)

Compute square root of x.

tan
real tan(real x)

Returns tangent of x. x is in radians.

tanh
real tanh(real x)

Calculates the hyperbolic tangent of x.

tanl
real tanl(real )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
trunc
real trunc(real x)

Returns the integer portion of x, dropping the fractional portion.

Variables

E
enum real E;

e

EULERGAMMA
enum real EULERGAMMA;

Euler-Mascheroni enumant 0.57721566..

LN10
enum real LN10;

ln 10

LN2
enum real LN2;

ln 2

LOG10E
enum real LOG10E;

log10e

LOG2
enum real LOG2;

log102

LOG2E
enum real LOG2E;

log2e

LOG2T
enum real LOG2T;

log210

MAXLOG
enum real MAXLOG;

log(real.max)

MINLOG
enum real MINLOG;

log(real.min_normal*real.epsilon)

M_1_PI
enum real M_1_PI;

1 / π

M_2_PI
enum real M_2_PI;

2 / π

M_2_SQRTPI
enum real M_2_SQRTPI;

2 / √π

PI
enum real PI;

$(_PI)

PI_2
enum real PI_2;

π / 2

PI_4
enum real PI_4;

π / 4

SQRT1_2
enum real SQRT1_2;

√$(HALF)

SQRT2
enum real SQRT2;

√2

Meta