Boron 0.1.0

Datatype Bignum
[Urlan Datatype System]

64.48 fixed point numbers appropriate for storage in UCells. More...

Files

file  bignum.h

Functions

void bignum_zero (UCell *cell)
 Set bignum to zero.
void bignum_seti (UCell *cell, int n)
 Initialize bignum from an integer.
void bignum_setl (UCell *cell, int64_t n)
 Initialize bignum from a 64-bit integer.
void bignum_setd (UCell *cell, double n)
 Initialize bignum from a double.
int64_t bignum_l (const UCell *cell)
 Convert the bignum to a 64-bit integer.
double bignum_d (const UCell *cell)
 Convert the bignum to a double.
int bignum_equal (const UCell *a, const UCell *b)
 Test if two bignums are the same.
int bignum_cmp (const UCell *a, const UCell *b)
 Compare two bignums.
void bignum_abs (UCell *cell)
 Convert to absolute value.
void bignum_negate (const UCell *cell, UCell *result)
 Negate the bignum.
void bignum_add (const UCell *a, const UCell *b, UCell *result)
 Get the sum of two bignums.
void bignum_sub (const UCell *a, const UCell *b, UCell *result)
 Get the difference between two bignums.
void bignum_mul (const UCell *a, const UCell *b, UCell *result)
 Get the product of two bignums.

Detailed Description

64.48 fixed point numbers appropriate for storage in UCells.


Function Documentation

void bignum_add ( const UCell a,
const UCell b,
UCell result 
)

Get the sum of two bignums.

A, b, & result may point to the same cell.

int bignum_cmp ( const UCell a,
const UCell b 
)

Compare two bignums.

Returns:
1, 0, or -1 if a is greater than, equal to, or less than b.

int bignum_equal ( const UCell a,
const UCell b 
)

Test if two bignums are the same.

Returns:
Non-zero if the bignum cells are equal.

void bignum_mul ( const UCell a,
const UCell b,
UCell result 
)

Get the product of two bignums.

A, b, & result may point to the same cell.

void bignum_negate ( const UCell cell,
UCell result 
)

Negate the bignum.

Cell and result may be the same.

void bignum_sub ( const UCell a,
const UCell b,
UCell result 
)

Get the difference between two bignums.

A, b, & result may point to the same cell.


Generated on 27 Jan 2012 by Doxygen 1.5.1