Special return values of ilogb.
Create a quiet NaN, storing an integer inside the payload.
Calculates the absolute value of a number.
Calculates the arc cosine of x, returning a value ranging from 0 to π.
Calculates the inverse hyperbolic cosine of x.
Computes whether a values is approximately equal to a reference value, admitting a maximum relative difference, and a maximum absolute difference.
Calculates the arc sine of x, returning a value ranging from -π/2 to π/2.
Calculates the inverse hyperbolic sine of x.
Calculates the arc tangent of x, returning a value ranging from -π/2 to π/2.
Calculates the arc tangent of y / x, returning a value ranging from -π to π.
Calculates the inverse hyperbolic tangent of x, returning a value from ranging from -1 to 1.
Calculates the cube root of x.
Returns the value of x rounded upward to the next integer (toward positive infinity).
Returns the value of x rounded upward to the next integer (toward positive infinity).
Defines a total order on all floating-point numbers.
Returns cosine of x. x is in radians.
Calculates the hyperbolic cosine of x.
Calculates ex.
Calculates 2x.
Calculates the value of the natural logarithm base (e) raised to the power of x, minus 1.
Returns |x|
Returns |x|
Returns the positive difference between x and y.
To what precision is x equal to y?
Returns the value of x rounded downward to the next integer (toward negative infinity).
Returns the value of x rounded downward to the next integer (toward negative infinity).
Returns (x * y) + z, rounding only once according to the current rounding mode.
Returns the larger of x and y.
Returns the smaller of x and y.
Calculates the remainder from the calculation x/y.
Separate floating point value into significand and exponent.
Extract an integral payload from a NaN.
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:
Extracts the exponent of x as a signed integral value.
Extracts the exponent of x as a signed integral value.
Computes whether two values are approximately equal, admitting a maximum relative difference, and a maximum absolute difference.
Determines if x is finite.
Is the binary representation of x identical to y?
Determines if x is ±∞.
Determines if x is NaN.
Determines if x is normalized.
Check whether a number is an integer power of two.
Determines if x is subnormal.
Compute n * 2exp References: frexp
Calculate the natural logarithm of x.
Calculate the base-10 logarithm of x.
Calculates the natural logarithm of 1 + x.
Calculates the base-2 logarithm of x: log2x
Extracts the exponent of x as a signed integral value.
Rounds x to the nearest integer value, using the current rounding mode.
Return the value of x rounded to the nearest integer.
Breaks x into an integral part and a fractional part, each of which has the same sign as x. The integral part is stored in i.
Rounds x to the nearest integer value, using the current rounding mode.
Calculate the next smallest floating point value before x.
Gives the next power of two after val. T can be any built-in numerical type.
Calculate the next largest floating point value after x.
Calculates the next representable value after x in the direction of y.
Evaluate polynomial A(x) = a0 + a1x + a2x2 + a3x3; ...
Compute the value of x n, where n is an integer
Compute the power of two integral numbers.
Computes integer to floating point powers.
Calculates xy.
Computes the value of a positive integer x, raised to the power n, modulo m.
Round val to a multiple of unit. rfunc specifies the rounding function to use; by default this is rint, which uses the current rounding mode.
Round val to a multiple of pow(base, exp). rfunc specifies the rounding function to use; by default this is rint, which uses the current rounding mode.
Calculate the remainder x REM y, following IEC 60559.
Set all of the floating-point status flags to false.
Rounds x to the nearest integer value, using the current rounding mode.
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.
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.
Deprecated. Please use round instead.
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.
Efficiently calculates x * 2n.
Returns -1 if x < 0, x if x == 0, 1 if x > 0, and NaN if x==NaN.
Return 1 if sign bit of e is set, 0 if not.
Calculates the hyperbolic sine of x.
Calculates the hyperbolic sine of x.
Compute square root of x.
Compute square root of x.
Returns tangent of x. x is in radians.
Returns tangent of x. x is in radians.
Calculates the hyperbolic tangent of x.
Calculates the hyperbolic tangent of x.
Returns the integer portion of x, dropping the fractional portion. This is also known as "chop" rounding. pure on all platforms.
Gives the last power of two before val. $(T) can be any built-in numerical type.
Control the Floating point hardware
IEEE exception status flags ('sticky bits')
Copyright The D Language Foundation 2000 - 2011. D implementations of tan, atan, atan2, exp, expm1, exp2, log, log10, log1p, log2, floor, ceil and lrint functions are based on the CEPHES math library, which is Copyright (C) 2001 Stephen L. Moshier <steve@moshier.net> and are incorporated herein by permission of the author. The author reserves the right to distribute this material elsewhere under different copying permissions. These modifications are distributed here under the following terms:
Contains the elementary mathematical functions (powers, roots, and trigonometric functions), and low-level floating-point operations. Mathematical special functions are available in std.mathspecial.
The functionality closely follows the IEEE754-2008 standard for floating-point arithmetic, including the use of camelCase names rather than C99-style lower case names. All of these functions behave correctly when presented with an infinity or NaN.
The following IEEE 'real' formats are currently supported:
Unlike C, there is no global 'errno' variable. Consequently, almost all of these functions are pure nothrow.