core.math

Builtin mathematical intrinsics

Members

Functions

cos
real cos(real x)

Returns cosine of x. x is in radians.

fabs
real fabs(real x)

Returns |x|

ldexp
real ldexp(real n, int exp)

Compute n * 2exp References: frexp

rint
real rint(real 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(real 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
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
real sin(real 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
real yl2x(real x, real y)

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

Meta

Authors

Walter Bright, Don Clugston

Suggestion Box / Bug Report