If a constant has already been calculated, this function attempts to use an existing value rather than recalculate. If the constant has not yet been calculated to the desired precision, returns false.
Calculates the value of 1/pi in the specified context.
Calculates the value of 1/pi in the specified context.
Decimal version of std.math function.
Decimal version of std.math function.
Decimal version of std.math function.
Decimal version of std.math function.
Returns the arctangent of the argument in the specified context. Algorithm uses Taylor's theorem for arctangent.
Decimal version of std.math function.
Decimal version of std.math function.
Calculates the value of e to the specified precision. Returns the calculated value.
Returns pi (3.14159265...) for the specified context.
Returns the nearest integer greater than or equal to the argument. Rounds toward positive infinity.
Changes the current precision and sets rounding to HALF_EVEN. This is useful for extended calculation to minimize errors. Returns a new context with the precision increased by the guard digits value. Note that this does not create a new Decimal type with this context.
Decimal version of std.math function.
Decimal version of std.math function. Precondition: x is in 1st quadrant.
Decimal version of std.math function.
Decimal version of std.math function.
Returns the exponent of the argument at the specified precision.
Returns the exponent of the argument at the current precision. Decimal version of std.math function. Required by General Decimal Arithmetic Specification
expm1(x) will be more accurate than exp(x) - 1 for x << 1. Decimal version of std.math function. Reference: Beebe, Nelson H. F., "Computation of expm1(x) = exp(x) - 1".
Returns the nearest integer less than or equal to the argument. Rounds toward negative infinity.
Adds guard digits to the current precision and sets rounding to HALF_EVEN. This is useful for extended calculation to minimize errors. Returns a new context with the precision increased by the guard digits value. Note that this does not create a new Decimal type with this context.
Returns the square root of the sum of the squares in the specified context. Decimal version of std.math.hypot.
base 2 logarithm of e = 1.44269504...
natural logarithm of 10 = 2.30258509...
natural logarithm of 2 = 0.693147806...
Returns the logarithm of the argument at the specified precision.
Decimal version of std.math.log10. Required by General Decimal Arithmetic Specification
log1p (== log(1 + x)). Decimal version of std.math function.
Decimal version of std.math.log2. Required by General Decimal Arithmetic Specification
Decimal version of std.math.pow. Required by General Decimal Arithmetic Specification
Returns the value of the function at the specified precision.
Rounds the argument to the nearest integer. If the argument is exactly half-way between two integers the even integer is returned.
Decimal version of std.math function.
Replaces std.math function expi
Decimal version of std.math function.
Returns the square root of the argument to the current precision. Uses Newton's method.
Returns the square root of two (1.41421357...) at the specified precision.
Decimal version of std.math function.
Returns the nearest extended integer value. The value is rounded based on the specified rounding mode. The default mode is half-even.
Returns the nearest integer value. If the value is greater (less) than the maximum (minimum) int value the maximum (minimum) value is returned. The value is rounded based on the specified rounding mode. The default mode is half-even.
Returns the nearest long value. If the value is greater (less) than the maximum (minimum) long value the maximum (minimum) value is returned. The value is rounded based on the specified rounding mode. The default mode is half-even.
Returns the truncated argument. Rounds toward zero.
Returns pi (3.14159265...) at the specified precision. If the precision is less than or equal to a prior precision, the earlier calculated value is returned (rounded if needed). If the specified precision is higher than any previously calculated precision, then the constant is recalculated and the higher value is retained for subsequent use. Repeated calls to the function at the same precision perform no rounding or calculation.
Copyright 2009-2016 by Paul D. Anderson.
Conforms to the General Decimal Arithmetic Specification, Version 1.70, (25 March 2009).
<a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>
Floating-point decimal mathematical functions.
An implementation of the General Decimal Arithmetic Specification.