Infinite precision Real number (LNGREAL)


Functions

bool isLNGREAL (SatAddr src)
 is the object a LNGREAL
bool LNGREALdecoded (SatAddr src, double *dst)
 Convert LNGREAL to C double.
SatAddr LNGREALencoded (double src, SatAddr dst)
 Convert a C double to an HP LNGREAL.
bool LNGREALdecodell (SatAddr src, long long *mantissa, long long *exponent)
 Decode a LNGREAL to its mantissa and exponent.
SatAddr LNGREALencodell (long long mantissa, long long exponent, SatAddr dst)
 Encode a LNGREAL from its mantissa and exponent.
bool LNGREALdecodeStr (SatAddr src, char *mantissa, char *exponent)
 Decode a LNGREAL to its mantissa and exponent expressed as null-terminated ASCII strings.
SatAddr LNGREALencodeStr (const char *mantissa, const char *exponent, SatAddr dst)
 Encode a LNGREAL from its mantissa and exponent expressed as null-terminated ASCII strings.
SatAddr makeLNGREAL (int numMdigits, int numEdigits)
 Create a new LNGREAL in tempOb. Populate it with zero.
int LNGREALnibbles (SatAddr src)
 The size of a LNGREAL in nibbles.
bool LNGREALdigits (SatAddr src, int *mDigits, int *eDigits)
 Get the number of digits in a LNGREAL's mantissa and exponent.
bool LNGREALbytes (SatAddr src, int *mBytes, int *eBytes)
 Get the number of bytes required to store a LNGREAL's mantissa and exponent as strings.

Detailed Description

A LNGREAL is like an infinite precision integer (INT), but it has infinite precision mantissa and exponent. Note that this is different from the 15 digit extended-real object (EREL) built in to the calculator.

I've done limited testing on these because there is no software built-in to the calculator that handles them (except to display them). "Programming in Saturn Assembly" says that there are libraries that can manipulate them.

Note that unlike REAL numbers, the decimal point always comes after the LAST mantissa digit, not the first. So if the mantissa is 123 and the exponent is 0, that means 123.0, not 1.23.


Function Documentation

bool isLNGREAL ( SatAddr  src  ) 

is the object a LNGREAL

Parameters:
src Saturn address of an object
Returns:
true if the object at src is a LNGREAL

bool LNGREALbytes ( SatAddr  src,
int *  mBytes,
int *  eBytes 
)

Get the number of bytes required to store a LNGREAL's mantissa and exponent as strings.

Parameters:
src Saturn address of a LNGREAL object.
mBytes If non-null then the number of digits required to store the mantissa as a null-terminated ASCII string, including a possible leading minus sign ("-") and a terminating null byte.
eBytes If non-null then the number of digits required to store the exponent as a null-terminated ASCII string, including a possible leading minus sign ("-") and a terminating null byte.
Returns:
true on success, false if src isn't a LNGREAL

bool LNGREALdecoded ( SatAddr  src,
double *  dst 
)

Convert LNGREAL to C double.

Parameters:
src The LNGREAL to decode
dst Where to store the LNGREAL's value
Returns:
true on success, false if src doesn't contain a LNGREAL
Some HP LNGREALs are too large or too small to be represented in a C double and will result in a very large or very small number.

bool LNGREALdecodell ( SatAddr  src,
long long *  mantissa,
long long *  exponent 
)

Decode a LNGREAL to its mantissa and exponent.

Parameters:
src The LNGREAL to decode
mantissa If non-null, then the mantissa will be stored here.
exponent If non-null then the exponent will be stored here.
Returns:
true on success, false if the mantissa or exponent won't fit in a long long.

bool LNGREALdecodeStr ( SatAddr  src,
char *  mantissa,
char *  exponent 
)

Decode a LNGREAL to its mantissa and exponent expressed as null-terminated ASCII strings.

Parameters:
src The LNGREAL to decode
mantissa If non-null, then the mantissa will be stored here as a null-terminated string. mantissa must point to sufficient space for the string. You can get the required size with LNGREALbytes()
exponent If non-null, then the exponent will be stored here as a null-terminated string. Exponent must point to sufficient space for the string. You can get the required size with LNGREALbytes()
Returns:
true on success, false if src isn't a LNGREAL.
See also:
LNGREALbytes()

bool LNGREALdigits ( SatAddr  src,
int *  mDigits,
int *  eDigits 
)

Get the number of digits in a LNGREAL's mantissa and exponent.

Parameters:
src Saturn address of a LNGREAL object.
mDigits If non-null then the number of digits in the mantissa will be stored here. eDigits If non-null then the number of digits in the exponent will be stored here.
Returns:
true on success, false if src is not a LNGREAL

SatAddr LNGREALencoded ( double  src,
SatAddr  dst 
)

Convert a C double to an HP LNGREAL.

Parameters:
src The double to convert.
dst Where to store the LNGREAL. If zero then a new LNGREAL is created.
Returns:
The LNGREAL's Saturn address, or zero on error

SatAddr LNGREALencodell ( long long  mantissa,
long long  exponent,
SatAddr  dst 
)

Encode a LNGREAL from its mantissa and exponent.

Parameters:
mantissa The mantissa part.
exponent The exponent part.
dst Where to store the LNGREAL. If zero then a new LNGREAL is created.
Returns:
The LNGREAL's Saturn address, or zero on error

SatAddr LNGREALencodeStr ( const char *  mantissa,
const char *  exponent,
SatAddr  dst 
)

Encode a LNGREAL from its mantissa and exponent expressed as null-terminated ASCII strings.

Parameters:
mantissa ASCII string of the mantissa
exponent ASCII string of the exponent part.
dst Where to store the LNGREAL. If zero then a new LNGREAL is created.
Returns:
The LNGREAL's Saturn address, or zero on error

int LNGREALnibbles ( SatAddr  src  ) 

The size of a LNGREAL in nibbles.

Parameters:
src Saturn address of the LNGREAL.
Returns:
The size of the LNGREAL in nibbles.


Generated on Sat Apr 3 16:38:31 2010 for HPObjects by  doxygen 1.5.0