Complex Numbers (CMP)


Defines

#define CMPnibbles(src)   (37)
 The size of a CMP in nibbles.

Functions

bool isCMP (SatAddr src)
 is object a Complex number (CMP)?
bool CMPdecode (SatAddr src, double *re, double *im)
 Decode CMP into it's real and imaginary components.
SatAddr CMPencode (double re, double im, SatAddr dst)
 Convert two C doubles into an HP CMP object.
SatAddr makeCMP ()
 Create a new CMP in tempOb. It's value is undefined.

Detailed Description

A complex number contains a real part and an imaginary part.

Define Documentation

#define CMPnibbles ( src   )     (37)

The size of a CMP in nibbles.

Parameters:
src Saturn address of the CMP. Although unnecessary, the parameter is included for consistency
Returns:
Always returns 37


Function Documentation

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

Decode CMP into it's real and imaginary components.

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

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

Convert two C doubles into an HP CMP object.

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

bool isCMP ( SatAddr  src  ) 

is object a Complex number (CMP)?

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


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