Infinite precision Complex number (LNGCOMP)


Functions

bool isLNGCOMP (SatAddr src)
 is the object a LNGCOMP
bool LNGCOMPdecoded (SatAddr src, double *re, double *im)
 Convert LNGCOMP to C doubles.
SatAddr LNGCOMPencoded (double re, double im, SatAddr dst)
 Convert two C doubles to an HP LNGCOMP.
bool LNGCOMPdecodell (SatAddr src, long long *re_mantissa, long long *re_exponent, long long *im_mantissa, long long *im_exponent)
 Decode a LNGCOMP into its mantissa and exponent expressed as C long longs.
SatAddr LNGCOMPencodell (long long re_mantissa, long long re_exponent, long long im_mantissa, long long im_exponent, SatAddr dst)
 Encode a LNGCOMP from its real and imaginary mantissa and exponent expressed as C long longs.
SatAddr LNGCOMPencodeStr (const char *re_mantissa, const char *re_exponent, const char *im_mantissa, const char *im_exponent, SatAddr dst)
 Encode a LNGCOMP from its real and imaginary mantissa and exponent expressed as null-terminated ASCII strings.
SatAddr LNGCOMPdecodeStr (SatAddr src, char *re_mantissa, char *re_exponent, char *im_mantissa, char *im_exponent)
 Decode a LNGCOMP to its components expressed as null-terminated ASCII strings.
SatAddr makeLNGCOMP (int numReMdigits, int numReEdigits, int numImMdigits, int numImEdigits)
 Create a new LNGCOMP in tempOb. Withe space for the specified number of digits in each component.
int LNGCOMPnibbles (SatAddr src)
 The size of a LNGCOMP in nibbles.
bool LNGCOMPdigits (SatAddr src, int *mReDigits, int *eReDigits, int *mImDigits, int *eImDigits)
 Get the number of digits in a LNGCOMP's real/imaginary mantissa and exponent.
bool LNGCOMPbytes (SatAddr src, int *mReBytes, int *eReBytes, int *mImBytes, int *eImBytes)
 Get the number of bytes required to store the components of a LNGCOMP as null-terminated ASCII strings.

Detailed Description

This is basically a complex number formed from the body of two LNGREALs.

Function Documentation

bool isLNGCOMP ( SatAddr  src  ) 

is the object a LNGCOMP

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

bool LNGCOMPbytes ( SatAddr  src,
int *  mReBytes,
int *  eReBytes,
int *  mImBytes,
int *  eImBytes 
)

Get the number of bytes required to store the components of a LNGCOMP as null-terminated ASCII strings.

Parameters:
src Saturn address of a LNGCOMP object.
mReDigits If non-null then the number of bytes required by the mantissa of the real part will be stored here.
eReDigits If non-null then the number of bytes required by the exponent of the real part will be stored here.
mImDigits If non-null then the number of bytes required by the mantissa of the imaginary part will be stored here.
eImDigits If non-null then the number of bytes required by the exponent of the imaginary part will be stored here.
Returns:
true on success, false if src is not a LNGCOMP.

bool LNGCOMPdecoded ( SatAddr  src,
double *  re,
double *  im 
)

Convert LNGCOMP to C doubles.

Some HP LNGCOMPs are too large or too small to be represented by C doubles and will result in a very large or very small number.

Parameters:
src The LNGCOMP to decode
re If non-null, the real part will be stored here.
im If non-null, the imaginary part will be stored here.
Returns:
true on success, false if src doesn't contain a LNGCOMP

bool LNGCOMPdecodell ( SatAddr  src,
long long *  re_mantissa,
long long *  re_exponent,
long long *  im_mantissa,
long long *  im_exponent 
)

Decode a LNGCOMP into its mantissa and exponent expressed as C long longs.

Parameters:
src The LNGCOMP to decode
re_mantissa If non-null, then the real part of the mantissa will be stored here.
re_exponent If non-null, then the real part of the exponent will be stored here.
im_mantissa If non-null, then the imaginary part of the mantissa will be stored here.
im_exponent If non-null, then the imaginary part of the exponent will be stored here.
Returns:
true on success, false if any of the components won't fit in a long long.

SatAddr LNGCOMPdecodeStr ( SatAddr  src,
char *  re_mantissa,
char *  re_exponent,
char *  im_mantissa,
char *  im_exponent 
)

Decode a LNGCOMP to its components expressed as null-terminated ASCII strings.

If non-null, the re_mantissa, re_exponent, im_mantissa and im_exponent parameters must point to sufficient space to hold their respective components expressed as ASCII strings. You can getthe space required through the LNGCOMPbytes() function.

Parameters:
src The LNGCOMP to decode
re_mantissa If non-null, then the mantissa of the real part will be stored here as a null-terminated ASCII string.
re_exponent If non-null, then the exponent of the real part will be stored here as a null-terminated ASCII string.
im_mantissa If non-null, then the mantissa of the imaginary part will be stored here as a null-terminated ASCII string.
im_exponent If non-null, then the exponent of the imaginary part will be stored here as a null-terminated ASCII string.
Returns:
true on success, false if src isn't a LNGCOMP.
See also:
LNGCOMPbytes()

bool LNGCOMPdigits ( SatAddr  src,
int *  mReDigits,
int *  eReDigits,
int *  mImDigits,
int *  eImDigits 
)

Get the number of digits in a LNGCOMP's real/imaginary mantissa and exponent.

Parameters:
src Saturn address of a LNGCOMP object.
mReDigits If non-null then the number of digits in the mantissa of the real part will be stored here.
eReDigits If non-null then the number of digits in the exponent of the real part will be stored here.
mImDigits If non-null then the number of digits in the mantissa of the imaginary part will be stored here.
eImDigits If non-null then the number of digits in the exponent of the imaginary part will be stored here.
Returns:
true on success, false if src is not a LNGCOMP.

SatAddr LNGCOMPencoded ( double  re,
double  im,
SatAddr  dst 
)

Convert two C doubles to an HP LNGCOMP.

Parameters:
re The real part.
im The imaginary part.
dst Where to store the LNGCOMP. If zero then a new LNGCOMP is created.
Returns:
The LNGCOMP's Saturn address, or zero on error

SatAddr LNGCOMPencodell ( long long  re_mantissa,
long long  re_exponent,
long long  im_mantissa,
long long  im_exponent,
SatAddr  dst 
)

Encode a LNGCOMP from its real and imaginary mantissa and exponent expressed as C long longs.

Parameters:
re_mantissa Mantissa of real part
re_exponent Exponent of real part
im_mantissa Mantissa of imaginary part
im_exponent Exponent of imaginary part
dst Where to store the LNGCOMP. If zero then a new LNGCOMP is created.
Returns:
The LNGCOMP's Saturn address, or zero on error

SatAddr LNGCOMPencodeStr ( const char *  re_mantissa,
const char *  re_exponent,
const char *  im_mantissa,
const char *  im_exponent,
SatAddr  dst 
)

Encode a LNGCOMP from its real and imaginary mantissa and exponent expressed as null-terminated ASCII strings.

Parameters:
re_mantissa Mantissa of real part
re_exponent Exponent of real part
im_mantissa Mantissa of imaginary part
im_exponent Exponent of imaginary part
dst Where to store the LNGCOMP. If zero then a new LNGCOMP is created.
Returns:
The LNGCOMP's Saturn address, or zero on error

int LNGCOMPnibbles ( SatAddr  src  ) 

The size of a LNGCOMP in nibbles.

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

SatAddr makeLNGCOMP ( int  numReMdigits,
int  numReEdigits,
int  numImMdigits,
int  numImEdigits 
)

Create a new LNGCOMP in tempOb. Withe space for the specified number of digits in each component.

Returns:
The Saturn address of the LNGCOMP.


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