Expand description
Rust bindings for The decNumber C library by IBM Fellow Mike Cowlishaw.
Structs§
- DecContext
- Decimal context.
- DecNumber
- Arbitrary precision decimal number.
Constants§
- DEC_
DOUBLE_ BYTES - Length in bytes of DecDouble union.
- DEC_
DOUBLE_ STRING - Maximum length of the DecDouble string.
- DEC_
DOUBLE_ STRING_ BUFFER - Buffer for DecDouble string.
- DEC_
DOUBLE_ ZERO - Convenient constant for DecDouble equal to positive zero.
- DEC_
FLOAT_ SIGN - Sign mask.
- DEC_INF
- Infinity mask: 1 = Infinity.
- DEC_
INIT_ BASE - Initializes context to ANSI X3-274 defaults.
- DEC_
INIT_ DECIMA L32 - Initializes context to IEEE 754 defaults, 32-bit.
- DEC_
INIT_ DECIMA L64 - Initializes context to IEEE 754 defaults, 64-bit.
- DEC_
INIT_ DECIMA L128 - Initializes context to IEEE 754 defaults, 128-bit.
- DEC_NAN
- Not-a-Number mask: 1 = NaN.
- DEC_NEG
- Sign mask: 1 = negative, 0 = positive or zero.
- DEC_
NUMBER_ BILLION - DecNumber value 1000000000 (billion).
- DEC_
NUMBER_ HUNDRED - DecNumber value 100 (hundred).
- DEC_
NUMBER_ MILLION - DecNumber value 1000000 (million).
- DEC_
NUMBER_ ONE - DecNumber value 1 (one).
- DEC_
NUMBER_ TEN - DecNumber value 10 (ten).
- DEC_
NUMBER_ THOUSAND - DecNumber value 1000 (thousand).
- DEC_
NUMBER_ TWO - DecNumber value 2 (two).
- DEC_
NUMBER_ ZERO - DecNumber value 0 (zero).
- DEC_
QUAD_ BILLION - DecQuad value
1000000000
(billion). - DEC_
QUAD_ BYTES - Length in bytes of the DecQuad union.
- DEC_
QUAD_ HUNDRED - DecQuad value
100
(hundred). - DEC_
QUAD_ MILLION - DecQuad value
1000000
(million). - DEC_
QUAD_ ONE - DecQuad value
1
(one). - DEC_
QUAD_ PMAX - Maximum precision (digits) for 128-bit decimals.
- DEC_
QUAD_ STRING - Maximum length of the DecQuad string.
- DEC_
QUAD_ STRING_ BUFFER - DecQuad string buffer.
- DEC_
QUAD_ TEN - DecQuad value
10
(ten). - DEC_
QUAD_ THOUSAND - DecQuad value
1000
(thousand). - DEC_
QUAD_ TWO - DecQuad value
2
(two). - DEC_
QUAD_ ZERO - DecQuad value
0
(zero). - DEC_
ROUND_ 05UP - Round for re-round.
- DEC_
ROUND_ CEILING - Round towards +Infinity.
- DEC_
ROUND_ DOWN - Round towards 0 (truncate).
- DEC_
ROUND_ FLOOR - Round towards -Infinity.
- DEC_
ROUND_ HALF_ DOWN - 0.5 rounds down.
- DEC_
ROUND_ HALF_ EVEN - 0.5 rounds to nearest even.
- DEC_
ROUND_ HALF_ UP - 0.5 rounds up.
- DEC_
ROUND_ UP - Round away from 0.
- DEC_
SINGLE_ BYTES - Length in bytes of DecSingle union.
- DEC_
SINGLE_ STRING - Maximum length of the DecSingle string.
- DEC_
SINGLE_ STRING_ BUFFER - Buffer for DecSingle string.
- DEC_
SINGLE_ ZERO - Convenient constant for DecSingle equal to positive zero.
- DEC_
SNAN - Signalling Not-a-Number mask: 1 = sNaN.
- DEC_
SPECIAL - Special value mask: 1 = special (Infinity, NaN or sNaN).
Functions§
- bcd
- Converts unsigned integer into BCD representation.
- bcd_
quad - Converts unsigned integer into BCD representation with maximum digits that fit into DecQuad.
- decContext
Default ⚠ - Unsafe binding to decContextDefault function.
- decContext
GetStatus ⚠ - Unsafe binding to decContextGetStatus function.
- decContext
Status ⚠ToString - Unsafe binding to decContextStatusToString function.
- decContext
Zero ⚠Status - Unsafe binding to decContextZeroStatus function.
- decDouble
Add ⚠ - Unsafe binding to decDoubleAdd function.
- decDouble
From ⚠String - Unsafe binding to decDoubleFromString function.
- decDouble
ToString ⚠ - Unsafe binding to decDoubleToString function.
- decDouble
Zero ⚠ - Unsafe binding to decDoubleZero function.
- decNumber
Add ⚠ - Unsafe binding to decNumberAdd function.
- decNumber
Compare ⚠ - Unsafe binding to decNumberCompare function.
- decNumber
Divide ⚠ - Unsafe binding to decNumberDivide function.
- decNumber
Exp ⚠ - Unsafe binding to decNumberExp function.
- decNumber
From ⚠Int32 - Unsafe binding to decNumberFromInt32 function.
- decNumber
From ⚠String - Unsafe binding to decNumberFromString function.
- decNumber
FromU ⚠Int32 - Unsafe binding to decNumberFromUInt32 function.
- decNumber
Ln ⚠ - Unsafe binding to decNumberLn function.
- decNumber
Minus ⚠ - Unsafe binding to decNumberMinus function.
- decNumber
Multiply ⚠ - Unsafe binding to decNumberMultiply function.
- decNumber
Plus ⚠ - Unsafe binding to decNumberPlus function.
- decNumber
Power ⚠ - Unsafe binding to decNumberPower function.
- decNumber
Quantize ⚠ - Unsafe binding to decNumberQuantize function.
- decNumber
Reduce ⚠ - Unsafe binding to decNumberReduce function.
- decNumber
Rescale ⚠ - Unsafe binding to decNumberRescale function.
- decNumber
ScaleB ⚠ - Unsafe binding to decNumberScaleB function.
- decNumber
SetBCD ⚠ - Unsafe binding to decNumberSetBCD function.
- decNumber
Square ⚠Root - Unsafe binding to decNumberSquareRoot function.
- decNumber
Subtract ⚠ - Unsafe binding to decNumberSubtract function.
- decNumber
ToString ⚠ - Unsafe binding to decNumberToString function.
- decNumber
Zero ⚠ - Unsafe binding to decNumberZero function.
- decQuad
Abs ⚠ - Unsafe binding to decQuadAbs function.
- decQuad
Add ⚠ - Unsafe binding to decQuadAdd function.
- decQuad
And ⚠ - Unsafe binding to decQuadAnd function.
- decQuad
Canonical ⚠ - Unsafe binding to decDoubleCanonical function.
- decQuad
Compare ⚠ - Unsafe binding to decQuadCompare function.
- decQuad
Compare ⚠Signal - Unsafe binding to decQuadCompareSignal function.
- decQuad
Compare ⚠Total - Unsafe binding to decQuadCompareTotal function.
- decQuad
Compare ⚠Total Mag - Unsafe binding to decQuadCompareTotalMag function.
- decQuad
Copy ⚠ - Unsafe binding to decQuadCopy function.
- decQuad
Copy ⚠Abs - Unsafe binding to decQuadCopyAbs function.
- decQuad
Copy ⚠Negate - Unsafe binding to decQuadCopyNegate function.
- decQuad
Copy ⚠Sign - Unsafe binding to decQuadCopySign function.
- decQuad
Digits ⚠ - Unsafe binding to decQuadDigits function.
- decQuad
Divide ⚠ - Unsafe binding to decQuadDivide function.
- decQuad
Divide ⚠Integer - Unsafe binding to decQuadDivideInteger function.
- decQuadFMA⚠
- Unsafe binding to decQuadFMA function.
- decQuad
FromBCD ⚠ - Unsafe binding to decQuadFromBCD function.
- decQuad
From ⚠Int32 - Unsafe binding to decQuadFromInt32 function.
- decQuad
From ⚠String - Unsafe binding to decQuadFromString function.
- decQuad
FromU ⚠Int32 - Unsafe binding to decQuadFromUInt32 function.
- decQuad
From ⚠Wider - Unsafe binding to decQuadFromWider function.
- decQuad
GetCoefficient ⚠ - Unsafe binding to decQuadGetCoefficient function.
- decQuad
GetExponent ⚠ - Unsafe binding to decQuadGetExponent function.
- decQuad
Invert ⚠ - Unsafe binding to decQuadInvert function.
- decQuad
IsCanonical ⚠ - Unsafe binding to decQuadIsCanonical function.
- decQuad
IsFinite ⚠ - Unsafe binding to decQuadIsFinite function.
- decQuad
IsInfinite ⚠ - Unsafe binding to decQuadIsInfinite function.
- decQuad
IsInteger ⚠ - Unsafe binding to decQuadIsInteger function.
- decQuad
IsLogical ⚠ - Unsafe binding to decQuadIsLogical function.
- decQuad
IsNaN ⚠ - Unsafe binding to decQuadIsNaN function.
- decQuad
IsNegative ⚠ - Unsafe binding to decQuadIsNegative function.
- decQuad
IsNormal ⚠ - Unsafe binding to decQuadIsNormal function.
- decQuad
IsPositive ⚠ - Unsafe binding to decQuadIsPositive function.
- decQuad
IsSignaling ⚠ - Unsafe binding to decQuadIsSignaling function.
- decQuad
IsSignalling ⚠ - Unsafe binding to decQuadIsSignalling function.
- decQuad
IsZero ⚠ - Unsafe binding to decQuadIsZero function.
- decQuad
Minus ⚠ - Unsafe binding to decQuadMinus function.
- decQuad
Multiply ⚠ - Unsafe binding to decQuadMultiply function.
- decQuad
Plus ⚠ - Unsafe binding to decQuadPlus function.
- decQuad
Quantize ⚠ - Unsafe binding to decQuadQuantize function.
- decQuad
Reduce ⚠ - Unsafe binding to decQuadReduce function.
- decQuad
Remainder ⚠ - Unsafe binding to decQuadRemainder function.
- decQuad
ScaleB ⚠ - Unsafe binding to decQuadScaleB function.
- decQuad
Subtract ⚠ - Unsafe binding to decQuadSubtract function.
- decQuad
ToInt32 ⚠ - Unsafe binding to decQuadToInt32 function.
- decQuad
ToIntegral ⚠Value - Unsafe binding to decQuadToIntegralValue function.
- decQuad
ToString ⚠ - Unsafe binding to decQuadToString function.
- decQuad
ToUInt32 ⚠ - Unsafe binding to decQuadToUInt32 function.
- decQuad
Zero ⚠ - Unsafe binding to decQuadZero function.
- decSingle
From ⚠String - Unsafe binding to decSingleFromString function.
- decSingle
From ⚠Wider - Unsafe binding to decSingleFromWider function.
- decSingle
ToString ⚠ - Unsafe binding to decSingleToString function.
- decSingle
ToWider ⚠ - Unsafe binding to decSingleToWider function.
- decSingle
Zero ⚠ - Unsafe binding to decSingleZero function.
- dec_
context_ 32 - Returns decimal context initialized for 32-bit decimals.
- dec_
context_ 64 - Returns decimal context initialized for 64-bit decimals.
- dec_
context_ 128 - Returns decimal context initialized for 128-bit decimals.
- dec_
context_ base - Returns decimal context initialized with maximum specified number of digits.
- dec_
context_ default - Safe binding to decContextDefault function.
- dec_
context_ get_ status - Safe binding to decContextGetStatus function.
- dec_
context_ status_ to_ string - Safe binding to decContextStatusToString function.
- dec_
context_ zero_ status - Safe binding to decContextZeroStatus function.
- dec_
double_ add - Safe binding to decDoubleAdd function.
- dec_
double_ from_ string - Safe binding to decDoubleFromString function.
- dec_
double_ to_ string - Safe binding to decDoubleToString function.
- dec_
double_ zero - Safe binding to decDoubleZero function.
- dec_
number_ add - Safe binding to decNumberAdd function.
- dec_
number_ compare - Safe binding to decNumberCompare function.
- dec_
number_ divide - Safe binding to decNumberDivide function.
- dec_
number_ exp - Safe binding to decNumberExp function.
- dec_
number_ from_ i32 - Safe binding to decNumberFromInt32 function.
- dec_
number_ from_ string - Safe binding to decNumberFromString function.
- dec_
number_ from_ u32 - Safe binding to decNumberFromUInt32 function.
- dec_
number_ is_ negative - Safe binding to decNumberIsNegative function.
- dec_
number_ is_ zero - Safe binding to decNumberIsZero function.
- dec_
number_ ln - Safe binding to decNumberLn function.
- dec_
number_ minus - Safe binding to decNumberMinus function.
- dec_
number_ multiply - Safe binding to decNumberMultiply function.
- dec_
number_ plus - Safe binding to decNumberPlus function.
- dec_
number_ power - Safe binding to decNumberPower function.
- dec_
number_ quantize - Safe binding to decNumberQuantize function.
- dec_
number_ reduce - Safe binding to decNumberReduce function.
- dec_
number_ rescale - Safe binding to decNumberRescale function.
- dec_
number_ scale_ b - Safe binding to decNumberScaleB function.
- dec_
number_ square_ root - Safe binding to decNumberSquareRoot function.
- dec_
number_ subtract - Safe binding to decNumberSubtract function.
- dec_
number_ to_ string - Safe binding to decNumberToString function.
- dec_
number_ zero - Safe binding to decNumberZero function.
- dec_
quad_ abs - Safe binding to decQuadAbs function.
- dec_
quad_ add - Safe binding to decQuadAdd function.
- dec_
quad_ and - Safe binding to decQuadAnd function.
- dec_
quad_ canonical - Safe binding to decQuadCanonical function.
- dec_
quad_ compare - Safe binding to decQuadCompare function.
- dec_
quad_ compare_ signal - Safe binding to decQuadCompareSignal function.
- dec_
quad_ compare_ total - Safe binding to decQuadCompareTotal function.
- dec_
quad_ compare_ total_ mag - Safe binding to decQuadCompareTotalMag function.
- dec_
quad_ copy - Safe binding to decQuadCopy function.
- dec_
quad_ copy_ abs - Safe binding to decQuadCopyAbs function.
- dec_
quad_ copy_ negate - Safe binding to decQuadCopyNegate function.
- dec_
quad_ copy_ sign - Safe binding to decQuadCopySign function.
- dec_
quad_ digits - Safe binding to decQuadDigits function.
- dec_
quad_ divide - Safe binding to decQuadDivide function.
- dec_
quad_ divide_ integer - Safe binding to decQuadDivideInteger function.
- dec_
quad_ fma - Safe binding to decQuadFMA function.
- dec_
quad_ from_ bcd - Safe binding to decQuadFromBCD function.
- dec_
quad_ from_ i32 - Safe binding to decQuadFromInt32 function.
- dec_
quad_ from_ string - Safe binding to decQuadFromString function.
- dec_
quad_ from_ u32 - Safe binding to decQuadFromUInt32 function.
- dec_
quad_ from_ wider - Safe binding to decQuadFromWider function.
- dec_
quad_ get_ coefficient - Safe binding to decQuadGetCoefficient function.
- dec_
quad_ get_ exponent - Safe binding to decQuadGetExponent function.
- dec_
quad_ invert - Safe binding to decQuadInvert function.
- dec_
quad_ is_ canonical - Safe binding to decQuadIsCanonical function.
- dec_
quad_ is_ finite - Safe binding to decQuadIsFinite function.
- dec_
quad_ is_ infinite - Safe binding to decQuadIsInfinite function.
- dec_
quad_ is_ integer - Safe binding to decQuadIsInteger function.
- dec_
quad_ is_ logical - Safe binding to decQuadIsLogical function.
- dec_
quad_ is_ nan - Safe binding to decQuadIsNaN function.
- dec_
quad_ is_ negative - Safe binding to decQuadIsNegative function.
- dec_
quad_ is_ normal - Safe binding to decQuadIsNormal function.
- dec_
quad_ is_ positive - Safe binding to decQuadIsPositive function.
- dec_
quad_ is_ signaling - Safe binding to decQuadIsSignaling function.
- dec_
quad_ is_ signalling - Safe binding to decQuadIsSignalling function.
- dec_
quad_ is_ zero - Safe binding to decQuadIsZero function.
- dec_
quad_ minus - Safe binding to decQuadMinus function.
- dec_
quad_ multiply - Safe binding to decQuadMultiply function.
- dec_
quad_ plus - Safe binding to decQuadPlus function.
- dec_
quad_ quantize - Safe binding to decQuadQuantize function.
- dec_
quad_ reduce - Safe binding to decQuadReduce function.
- dec_
quad_ remainder - Safe binding to decQuadRemainder function.
- dec_
quad_ scale_ b - Safe binding to decQuadScaleB function.
- dec_
quad_ subtract - Safe binding to decQuadSubtract function.
- dec_
quad_ to_ int32 - Safe binding to decQuadToInt32 function.
- dec_
quad_ to_ integral_ value - Safe binding to decQuadToIntegralValue function.
- dec_
quad_ to_ string - Safe binding to decQuadToString function.
- dec_
quad_ to_ uint32 - Safe binding to decQuadToUInt32 function.
- dec_
quad_ zero - Safe binding to decQuadZero function.
- dec_
single_ from_ string - Safe binding to decSingleFromString function.
- dec_
single_ to_ string - Safe binding to decSingleToString function.
- dec_
single_ zero - Safe binding to decSingleZero function.
- decimal32
From ⚠Number - Unsafe binding to decimal32FromNumber function.
- decimal32
ToNumber ⚠ - Unsafe binding to decimal32ToNumber function.
- decimal32_
from_ number - Safe binding to decimal32FromNumber function.
- decimal32_
to_ number - Safe binding to decimal32ToNumber function.
- decimal64
From ⚠Number - Unsafe binding to decimal64FromNumber function.
- decimal64
ToNumber ⚠ - Unsafe binding to decimal64ToNumber function.
- decimal64_
from_ number - Safe binding to decimal64FromNumber function.
- decimal64_
to_ number - Safe binding to decimal64ToNumber function.
- decimal128
From ⚠Number - Unsafe binding to decimal128FromNumber function.
- decimal128
ToNumber ⚠ - Unsafe binding to decimal128ToNumber function.
- decimal128_
from_ number - Safe binding to decimal128FromNumber function.
- decimal128_
to_ number - Safe binding to decimal128ToNumber function.