All Functions and Procedures

Name Unit Description
* bigdecimalmath

Standard operator binary *

** bigdecimalmath

Standard operator binary **

+ bigdecimalmath

Standard operator binary +

- bigdecimalmath

Standard operator unary -

- bigdecimalmath

Standard operator binary -

/ bigdecimalmath

Standard operator binary /
If the result can not be represented as finite decimal number (e.g. 1/3) it will be calculated with 18 digit precision after the decimal point, with an additional hidden digit for rounding (so 1/3 is 0.333333333333333333, and 0.333333333333333333*3 is 0.999999999999999999, but (1/3) * 3 is 1).

:= bigdecimalmath

Converts a native integer to a BigDecimal

:= bigdecimalmath

Converts an extended to a BigDecimal
Marked as deprecated, because it may lead to rounding errors. FloatToBigDecimal is exact, but probably some magnitudes slower. For constant values StrToBigDecimal should be used instead.

:= bigdecimalmath

Converts a native integer to a BigDecimal

:= bigdecimalmath

Converts a native integer to a BigDecimal

< bigdecimalmath

 

<= bigdecimalmath

 

= bigdecimalmath

 

> bigdecimalmath

 

>= bigdecimalmath

 

abs bigdecimalmath

Returns the absolute value of v

BigDecimalToExtended bigdecimalmath

Converts a bigdecimal to an extended (may introduce rounding errors)

BigDecimalToInt64 bigdecimalmath

Converts a bigdecimal to a native int (can overflow)

BigDecimalToLongint bigdecimalmath

Converts a bigdecimal to a native int (can overflow)

BigDecimalToStr bigdecimalmath

Converts a bigdecimal to a decimal string
The result will be fixed width format [0-9]+(.[0-9]+)?, even if the input had an exponent

compareBigDecimals bigdecimalmath

Compares the big decimals. Returns -1, 0 or 1 corresponding to a <, = or > b

div bigdecimalmath

Standard operator binary div
The result is an integer, so 1.23E3 / 7 will be 175

divide bigdecimalmath

Wrapper around divideModNoAlias, ignoring the calculated remainder

divideModNoAlias bigdecimalmath

Universal division/modulo function. Calculates the quotient and remainder of a / b.
bddfKeepDividentPrecision: calculates as least as many non-zero digit of the quotient as the divident (1st arg) has
bddfKeepDivisorPrecision: calculates as least as many non-zero digit of the quotient as the divisor (2nd arg) has
bddfAddHiddenDigit: Calculates an additional digit for rounding, which will not be displayed by BigDecimalToStr
bddfFillIntegerPart: Calculate at least all digits of the integer part of the quotient, independent of the precision of the input
bddfNoFractionalPart: Do not calculate the fractional part of the quotient (remember that a bigdecimal is a scaled integer. So bfdfFillIntegerPart ensures that the result has not less digits than an integer division (necessary in case of an exponent > 0) and bfdfKillFractions that the result has not more digits than an integer division (in case of an exponent < 0) )
not all flag combinations were tested

even bigdecimalmath

Checks if v is even. A number with fractional digits is never even (and neither odd, which is odd)

fastpower2to bigdecimalmath

Calculates 2 ** exp exactly, with exp being an integer (faster than power for negative exp)

fastpower5to bigdecimalmath

Calculates 5 ** exp exactly, with exp being an integer (faster than power for negative exp)

gcd bigdecimalmath

Calculates the greatest common denominator (only makes sense for positive integer input)

getDigit bigdecimalmath

Returns the digit-th digit of v.
Last integer digit is digit 0, digits at negative indices are behind the decimal point.

isInt64 bigdecimalmath

Returns true iff v has no fractional digits and can be stored within an int64

isIntegral bigdecimalmath

Returns true iff v has no fractional digits

isLongint bigdecimalmath

Returns true iff v has no fractional digits and can be stored within an longint (32 bit integer)

isZero bigdecimalmath

Returns true iff the bigdecimal is zero

lcm bigdecimalmath

Calculates the least common multiple

mod bigdecimalmath

Standard operator binary mod
Calculates the remainder of an integer division a - (a div b) * b

normalize bigdecimalmath

Removes leading (pre .) and trailing (post .) zeros

odd bigdecimalmath

Checks if v is odd. A number with fractional digits is never odd (only weird)

power bigdecimalmath

Calculates v ** exp, with exp being an integer

precision bigdecimalmath

How many non-zero digits the number contains

round bigdecimalmath

Universal rounding function
Rounds v to the precision of a certain digit, subject to a certain rounding mode.
Positive toDigit will round to an integer with toDigit trailing zeros, negative toDigit will round to a decimal with -toDigit numbers after the decimal point

roundInRange bigdecimalmath

Given mi < exact < ma, truncate exact to a bigdecimal result, such that
mi < result < ma
result has the minimal number of non-zero digits
| result - exact | is minimized

setOne bigdecimalmath

Sets the bigdecimal to 1

setZero bigdecimalmath

Sets the bigdecimal to 0

shift10 bigdecimalmath

Calculates a decimal shift: v := v * 10ˆshift

shifted10 bigdecimalmath

Calculates a decimal shift: result := v * 10ˆshift

sqrt bigdecimalmath

Calculates the square root of v, to precision digits after the decimal point
Not much tested

StrToBigDecimal bigdecimalmath

Converts a decimal string to a bigdecimal.
Supports standard decimal notation, like -123.456 or 1E-2 (-?[0-9]+(.[0-9]+)?([eE][-+]?[0-9]+)) Raises an exception on invalid input.

TryStrToBigDecimal bigdecimalmath

Converts a decimal string to a bigdecimal.
Supports standard decimal notation, like -123.456 or 1E-2 (-?[0-9]+(.[0-9]+)?([eE][-+]?[0-9]+))


Generated by PasDoc 0.14.0.