The following functions are only treated as intrinsics during compile-time function execution (CTFE) phase of compilation to allow more functions to be computable at compile-time, either because their generic implementations are too complex, or do some low-level bit manipulation of floating point types.
Calls to these functions that exist after CTFE has finished will get standard code-generation without any special compiler intrinsic suppport.
float std.math.exponential.exp (float x) ¶double std.math.exponential.exp (double x) ¶real std.math.exponential.exp (real x) ¶Calculates e^x.
This function is evaluated during CTFE as the GCC built-in function
__builtin_exp.
float std.math.exponential.expm1 (float x) ¶double std.math.exponential.expm1 (double x) ¶real std.math.exponential.expm1 (real x) ¶Calculates e^x-1.0.
This function is evaluated during CTFE as the GCC built-in function
__builtin_expm1.
float std.math.exponential.exp2 (float x) ¶double std.math.exponential.exp2 (double x) ¶real std.math.exponential.exp2 (real x) ¶Calculates 2^x.
This function is evaluated during CTFE as the GCC built-in function
__builtin_exp2.
float std.math.exponential.log (float x) ¶double std.math.exponential.log (double x) ¶real std.math.exponential.log (real x) ¶Calculate the natural logarithm of x.
This function is evaluated during CTFE as the GCC built-in function
__builtin_log.
float std.math.exponential.log10 (float x) ¶double std.math.exponential.log10 (double x) ¶real std.math.exponential.log10 (real x) ¶Calculates the base-10 logarithm of x.
This function is evaluated during CTFE as the GCC built-in function
__builtin_log10.
float std.math.exponential.log2 (float x) ¶double std.math.exponential.log2 (double x) ¶real std.math.exponential.log2 (real x) ¶Calculates the base-2 logarithm of x.
This function is evaluated during CTFE as the GCC built-in function
__builtin_log2.
Largest!(F, G) std.math.exponential.pow (F, G) (F x, G y) ¶real std.math.exponential.pow (I, F)(I x, F y) ¶Calculates x^y, where y is a float.
This function is evaluated during CTFE as the GCC built-in function
__builtin_pow.
F std.math.exponential.pow (F, G) (F x, G n) ¶Calculates x^n, where n is an integer.
This function is evaluated during CTFE as the GCC built-in function
__builtin_powi.
real std.math.operations.fma (real x, real y, real z) ¶Returns (x * y) + z, rounding only once according to the current
rounding mode.
This function is evaluated during CTFE as the GCC built-in function
__builtin_fma.
F std.math.operations.fmax (F)(const F x, const F y) ¶Returns the larger of x and y.
This function is evaluated during CTFE as the GCC built-in function
__builtin_fmax.
F std.math.operations.fmin (F)(const F x, const F y) ¶Returns the smaller of x and y.
This function is evaluated during CTFE as the GCC built-in function
__builtin_fmin.
float std.math.rounding.ceil (float x) ¶double std.math.rounding.ceil (double x) ¶real std.math.rounding.ceil (real x) ¶Returns the value of x rounded upward to the next integer (toward positive infinity).
This function is evaluated during CTFE as the GCC built-in function
__builtin_ceil.
float std.math.rounding.floor (float x) ¶double std.math.rounding.floor (double x) ¶real std.math.rounding.floor (real x) ¶Returns the value of x rounded downward to the next integer (toward negative infinity).
This function is evaluated during CTFE as the GCC built-in function
__builtin_floor.
real std.math.rounding.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 away from zero.
This function is evaluated during CTFE as the GCC built-in function
__builtin_round.
real std.math.rounding.trunc (real x) ¶Returns the integer portion of x, dropping the fractional portion.
This function is evaluated during CTFE as the GCC built-in function
__builtin_trunc.
R std.math.traits.copysign (R, X)(R to, X from) ¶Returns a value composed of to with from’s sign bit.
This function is evaluated during CTFE as the GCC built-in function
__builtin_copysign.
bool std.math.traits.isFinite (X)(X x) ¶Returns true if x is finite.
This function is evaluated during CTFE as the GCC built-in function
__builtin_isfinite.
bool std.math.traits.isInfinity (X)(X x) ¶Returns true if x is infinite.
This function is evaluated during CTFE as the GCC built-in function
__builtin_isinf.
bool std.math.traits.isNaN (X)(X x) ¶Returns true if x is NaN.
This function is evaluated during CTFE as the GCC built-in function
__builtin_isnan.