core.math

Builtin mathematical intrinsics

Members

Functions

cos
float cos(float x)

Returns cosine of x. x is in radians.

fabs
float fabs(float x)

Compute the absolute value.

Special Values
xfabs(x)
±0.0+0.0
±∞+∞

It is implemented as a compiler intrinsic.

ldexp
float ldexp(float n, int exp)

Compute n * 2exp References: frexp

rint
float rint(float x)

Rounds x to the nearest integer value, using the current rounding mode. If the return value is not equal to x, the FE_INEXACT exception is raised. nearbyint performs the same operation, but does not set the FE_INEXACT exception.

rndtol
long rndtol(float x)

Returns x rounded to a long value using the current rounding mode. If the integer value of x is greater than long.max, the result is indeterminate.

rndtonl
deprecated real rndtonl(real x)

Returns x rounded to a long value using the FE_TONEAREST rounding mode. If the integer value of x is greater than long.max, the result is indeterminate.

sin
float sin(float x)

Returns sine of x. x is in radians.

sqrt
float sqrt(float x)

Compute square root of x.

toPrec
T toPrec(float f)
T toPrec(double f)
T toPrec(real f)

Round argument to a specific precision.

yl2x
float yl2x(float x, float y)

Building block functions, they translate to a single x87 instruction.

Meta

Authors

Walter Bright, Don Clugston