mir.math.common

Common floating point math functions.

This module has generic LLVM-oriented API compatible with all D compilers.

Members

Aliases

ceil
alias ceil = std.math.ceil
Undocumented in source.
cos
alias cos = std.math.cos
Undocumented in source.
exp
alias exp = std.math.exp
Undocumented in source.
exp2
alias exp2 = std.math.exp2
Undocumented in source.
fastmath
alias fastmath = ldc.attributes.fastmath

Functions attribute, an alias for ldc.attributes.fastmath .

floor
alias floor = std.math.floor
Undocumented in source.
fmamath
alias fmamath = AliasSeq!(ldc.attributes.llvmFastMathFlag("contract"))

Functions attribute, an alias for AliasSeq!(llvmFastMathFlag("contract"));.

optmath
alias optmath = AliasSeq!(ldc.attributes.llvmFastMathFlag("fast"))

Functions attribute, an alias for AliasSeq!(llvmFastMathFlag("fast")).

rint
alias rint = std.math.rint
Undocumented in source.
sin
alias sin = std.math.sin
Undocumented in source.
sqrt
alias sqrt = std.math.sqrt
Undocumented in source.
sqrt
alias sqrt = std.math.sqrt
Undocumented in source.

Enums

fmamath
anonymousenum fmamath
Undocumented in source.

Functions

approxEqual
bool approxEqual(T lhs, T rhs, float maxRelDiff, float maxAbsDiff)
bool approxEqual(T lhs, T rhs, double maxRelDiff, double maxAbsDiff)

Computes whether two values are approximately equal, admitting a maximum relative difference, and a maximum absolute difference.

approxEqual
bool approxEqual(T lhs, T rhs, T maxRelDiff, T maxAbsDiff)
bool approxEqual(T lhs, T rhs, real maxRelDiff, real maxAbsDiff)

Computes whether two values are approximately equal, admitting a maximum relative difference, and a maximum absolute difference.

ceil
T ceil(T val)
Undocumented in source.
ceil
T ceil(T x)
ceil
T ceil(T x)
ceil
T ceil(T x)
copysign
T copysign(T mag, T sgn)
Undocumented in source.
copysign
T copysign(T mag, T sgn)
copysign
T copysign(T mag, T sgn)
copysign
T copysign(T mag, T sgn)
cos
T cos(T val)
Undocumented in source.
cos
T cos(T x)
cos
T cos(T x)
cos
T cos(T x)
exp
T exp(T val)
Undocumented in source.
exp
T exp(T x)
exp
T exp(T x)
exp
T exp(T x)
exp2
T exp2(T val)
Undocumented in source.
exp2
T exp2(T x)
exp2
T exp2(T x)
exp2
T exp2(T x)
fabs
T fabs(T val)
Undocumented in source.
fabs
T fabs(T x)
fabs
T fabs(T x)
fabs
T fabs(T x)
fabs
auto fabs(T x)

Overload for cdouble, cfloat and creal

floor
T floor(T val)
Undocumented in source.
floor
T floor(T x)
floor
T floor(T x)
floor
T floor(T x)
fma
T fma(T vala, T valb, T valc)
Undocumented in source.
fmax
T fmax(T vala, T valb)
Undocumented in source.
fmax
T fmax(T x, T y)
fmax
T fmax(T x, T y)
fmax
T fmax(T x, T y)
fmin
T fmin(T vala, T valb)
Undocumented in source.
fmin
T fmin(T x, T y)
fmin
T fmin(T x, T y)
fmin
T fmin(T x, T y)
fmuladd
T fmuladd(T vala, T valb, T valc)
Undocumented in source.
fmuladd
T fmuladd(T a, T b, T c)
fmuladd
T fmuladd(T a, T b, T c)
fmuladd
T fmuladd(T a, T b, T c)
log
T log(T val)
Undocumented in source.
log
T log(T x)
log
T log(T x)
log
T log(T x)
log10
T log10(T val)
Undocumented in source.
log10
T log10(T x)
log10
T log10(T x)
log10
T log10(T x)
log2
T log2(T val)
Undocumented in source.
log2
T log2(T x)
log2
T log2(T x)
log2
T log2(T x)
nearbyint
T nearbyint(T val)
Undocumented in source.
nearbyint
T nearbyint(T x)
nearbyint
T nearbyint(T x)
nearbyint
T nearbyint(T x)
pow
T pow(T val, T power)
Undocumented in source.
pow
T pow(T x, T power)
pow
T pow(T x, T power)
pow
T pow(T x, T power)
powi
T powi(T val, int power)
Undocumented in source.
powi
T powi(T x, int power)
powi
T powi(T x, int power)
powi
T powi(T x, int power)
rint
T rint(T val)
Undocumented in source.
rint
T rint(T x)
rint
T rint(T x)
rint
T rint(T x)
round
T round(T val)
Undocumented in source.
round
T round(T x)
round
T round(T x)
round
T round(T x)
sin
T sin(T val)
Undocumented in source.
sin
T sin(T x)
sin
T sin(T x)
sin
T sin(T x)
sqrt
T sqrt(T val)
Undocumented in source.
sqrt
T sqrt(T x)
sqrt
T sqrt(T x)
sqrt
T sqrt(T x)
trunc
T trunc(T val)
Undocumented in source.
trunc
T trunc(T x)
trunc
T trunc(T x)
trunc
T trunc(T x)

Meta

License

Apache-2.0

Authors

Ilya Yaroshenko, Phobos Team