XBinder  Version 2.9.x
Functions
rtxBigNumber.h File Reference
#include "rtxsrc/rtxContext.h"

Go to the source code of this file.

Functions

int rtxAddBigNum (const OSOCTET *a, OSSIZE szA, const OSOCTET *b, OSSIZE szB, OSOCTET *c, OSSIZE szC)
 Addition big numbers: a + b = c. More...
 
int rtxSubBigNum (const OSOCTET *a, OSSIZE szA, const OSOCTET *b, OSSIZE szB, OSOCTET *c, OSSIZE szC)
 Substraction big numbers: a - b = c. More...
 
int rtxMulBigNum (const OSOCTET *a, OSSIZE szA, const OSOCTET *b, OSSIZE szB, OSOCTET *c, OSSIZE szC)
 Multiplication big numbers: a * b = c. More...
 
int rtxDivRemBigNum (const OSOCTET *a, OSSIZE szA, const OSOCTET *b, OSSIZE szB, OSOCTET *c, OSSIZE szC, OSOCTET *rem, OSSIZE szRem)
 Division big numbers with reminder: a / b = c. More...
 
int rtxDivBigNum (const OSOCTET *a, OSSIZE szA, const OSOCTET *b, OSSIZE szB, OSOCTET *c, OSSIZE szC)
 Division big numbers: a / b = c. More...
 
int rtxModBigNum (const OSOCTET *a, OSSIZE szA, const OSOCTET *b, OSSIZE szB, OSOCTET *rem, OSSIZE szRem)
 Division by module big numbers: a % b = rem. More...
 
int rtxBigNumToStr (const OSOCTET *a, OSSIZE szA, char *str, OSSIZE szStr)
 Convert big number to string. More...
 
int rtxStrToBigNum (const char *str, OSOCTET *a, OSSIZE szA)
 Convert string to big number. More...
 

Function Documentation

◆ rtxAddBigNum()

int rtxAddBigNum ( const OSOCTET *  a,
OSSIZE  szA,
const OSOCTET *  b,
OSSIZE  szB,
OSOCTET *  c,
OSSIZE  szC 
)

Addition big numbers: a + b = c.

Parameters
aFirst addend.
szALength of first addend in octets.
bSecond addend.
szBLength of second addend in octets.
cSum.
szCLength of sum buffer in octets.
Returns
Status of the operation. Zero if successful; a negative status code if overflow.

◆ rtxBigNumToStr()

int rtxBigNumToStr ( const OSOCTET *  a,
OSSIZE  szA,
char *  str,
OSSIZE  szStr 
)

Convert big number to string.

Parameters
aNumber.
szALength of number in octets.
strResult string.
szStrLength of string buffer in octets.
Returns
Status of the operation. Zero if successful; a negative status code if overflow.

◆ rtxDivBigNum()

int rtxDivBigNum ( const OSOCTET *  a,
OSSIZE  szA,
const OSOCTET *  b,
OSSIZE  szB,
OSOCTET *  c,
OSSIZE  szC 
)

Division big numbers: a / b = c.

Parameters
aDivident.
szALength of divident in octets.
bDivisor.
szBLength of divisor in octets.
cQuotient.
szCLength of quotient buffer in octets.
Returns
Status of the operation. Zero if successful; a negative status code if overflow.

◆ rtxDivRemBigNum()

int rtxDivRemBigNum ( const OSOCTET *  a,
OSSIZE  szA,
const OSOCTET *  b,
OSSIZE  szB,
OSOCTET *  c,
OSSIZE  szC,
OSOCTET *  rem,
OSSIZE  szRem 
)

Division big numbers with reminder: a / b = c.

Parameters
aDivident.
szALength of divident in octets.
bDivisor.
szBLength of divisor in octets.
cQuotient.
szCLength of quotient buffer in octets.
remReminder.
szRemLength of reminder buffer in octets.
Returns
Status of the operation. Zero if successful; a negative status code if overflow.

◆ rtxModBigNum()

int rtxModBigNum ( const OSOCTET *  a,
OSSIZE  szA,
const OSOCTET *  b,
OSSIZE  szB,
OSOCTET *  rem,
OSSIZE  szRem 
)

Division by module big numbers: a % b = rem.

Parameters
aDivident.
szALength of divident in octets.
bDivisor.
szBLength of divisor in octets.
remReminder.
szRemLength of reminder buffer in octets.
Returns
Status of the operation. Zero if successful; a negative status code if overflow.

◆ rtxMulBigNum()

int rtxMulBigNum ( const OSOCTET *  a,
OSSIZE  szA,
const OSOCTET *  b,
OSSIZE  szB,
OSOCTET *  c,
OSSIZE  szC 
)

Multiplication big numbers: a * b = c.

Parameters
aMultiplicand.
szALength of multiplicand in octets.
bMultiplier.
szBLength of multiplier in octets.
cProduct.
szCLength of product buffer in octets.
Returns
Status of the operation. Zero if successful; a negative status code if overflow.

◆ rtxStrToBigNum()

int rtxStrToBigNum ( const char *  str,
OSOCTET *  a,
OSSIZE  szA 
)

Convert string to big number.

Parameters
strInput null terminated string.
aResult number.
szALength of number buffer in octets.
Returns
Status of the operation. Zero if successful; a negative status code if overflow.

◆ rtxSubBigNum()

int rtxSubBigNum ( const OSOCTET *  a,
OSSIZE  szA,
const OSOCTET *  b,
OSSIZE  szB,
OSOCTET *  c,
OSSIZE  szC 
)

Substraction big numbers: a - b = c.

Parameters
aMinuend.
szALength of minuend in octets.
bSubstrahend.
szBLength of substrahend in octets.
cDifference.
szCLength of difference buffer in octets.
Returns
Status of the operation. Zero if successful; a negative status code if overflow.