HPGCC3 Documentation 3.0 R003

Complex functions

Functions

SAT_OBJECT sat3_createcplx_xreal (SAT_OBJECT where, XREAL *real, XREAL *imag)
 Create a complex from extended precision real numbers (XREAL).
BOOL sat3_convertcplx_xreal (SAT_OBJECT cplx, XREAL *real, XREAL *imag)
 Convert a complex into two extended precision reals (XREAL).
SAT_OBJECT sat3_createcplx_decn (SAT_OBJECT where, decNumber *real, decNumber *imag)
 Create a complex from variable precision real numbers (decNumber).
BOOL sat3_convertcplx_decn (SAT_OBJECT cplx, decNumber *real, decNumber *imag)
 Convert a complex into a variable precision real (decNumber).
SAT_OBJECT sat3_createcplx_dbl (SAT_OBJECT where, double real, double imag)
 Create a complex from two double's (real and imaginary parts).
BOOL sat3_convertcplx_dbl (SAT_OBJECT cplx, double *real, double *imag)
 Convert a complex into a pair of double's (real and imaginary parts).
SAT_OBJECT sat3_createcplx_int (SAT_OBJECT where, int real, int imag)
 Create a complex from two integers.
BOOL sat3_convertcplx_int (SAT_OBJECT cplx, int *real, int *imag)
 Convert a complex into two 32-bit integers.
SAT_OBJECT sat3_createcplx_llong (SAT_OBJECT where, LONGLONG real, LONGLONG imag)
 Create a complex from two LONGLONG integers (real and imaginary parts).
BOOL sat3_convertcplx_llong (SAT_OBJECT cplx, LONGLONG *real, LONGLONG *imag)
 Convert a complex into a pair of 64-bit integers.

Detailed Description

This group includes all functions used to create/convert complex.


Function Documentation

BOOL sat3_convertcplx_dbl ( SAT_OBJECT  cplx,
double *  real,
double *  imag 
)

Convert a complex into a pair of double's (real and imaginary parts).

This function converts a complex object to two double numbers.

Parameters:
cplxA SAT_OBJECT complex number.
realPointer to a previously allocated double that will receive the real part.
imagPointer to a previously allocated double that will receive the imaginary part.
Returns:
BOOL with TRUE if conversion was successful. When conversion fails it returns FALSE.
See also:
sat3_convertcplx_xreal sat3_convertcplx_decn sat3_convertcplx_int sat3_convertcplx_llong Object creation and manipulation
BOOL sat3_convertcplx_decn ( SAT_OBJECT  cplx,
decNumber real,
decNumber imag 
)

Convert a complex into a variable precision real (decNumber).

This function converts a complex object to a pair of decNumber's (real and imaginary parts).

Parameters:
cplxA SAT_OBJECT complex number.
realPointer to a previously allocated decNumber that will receive the real part. The number must have been allocated for 12 digits precision minimum.
imagPointer to a previously allocated decNumber that will receive the imaginary part. The number must have been allocated for 12 digits precision minimum.
Returns:
BOOL with TRUE if conversion was successful. When conversion fails it returns FALSE.
See also:
sat3_convertcplx_xreal sat3_convertcplx_dbl sat3_convertcplx_int sat3_convertcplx_llong Object creation and manipulation
BOOL sat3_convertcplx_int ( SAT_OBJECT  cplx,
int *  real,
int *  imag 
)

Convert a complex into two 32-bit integers.

This function converts a complex object to a pair of int's. Fractional part is discarded (no rounding).

Parameters:
cplxA SAT_OBJECT complex number.
realPointer to a previously allocated int that will receive the real part.
imagPointer to a previously allocated int that will receive the imaginary part.
Returns:
BOOL with TRUE if conversion was successful. When conversion fails it returns FALSE.
See also:
sat3_convertcplx_xreal sat3_convertcplx_decn sat3_convertcplx_dbl sat3_convertcplx_llong Object creation and manipulation
BOOL sat3_convertcplx_llong ( SAT_OBJECT  cplx,
LONGLONG real,
LONGLONG imag 
)

Convert a complex into a pair of 64-bit integers.

This function converts a complex object to two LONGLONG integers. Fractional part is discarded (no rounding).

Parameters:
cplxA SAT_OBJECT complex number.
realPointer to a previously allocated LONGLONG that will receive the real part.
imagPointer to a previously allocated LONGLONG that will receive the imaginary part.
Returns:
BOOL with TRUE if conversion was successful. When conversion fails it returns FALSE.
See also:
sat3_convertcplx_xreal sat3_convertcplx_decn sat3_convertcplx_dbl sat3_convertcplx_int Object creation and manipulation
BOOL sat3_convertcplx_xreal ( SAT_OBJECT  cplx,
XREAL real,
XREAL imag 
)

Convert a complex into two extended precision reals (XREAL).

This function converts a complex object to XREAL imaginary and real parts.

Parameters:
cplxA SAT_OBJECT complex number.
realPointer to a previously allocated XREAL that will receive the real part.
imagPointer to a previously allocated XREAL that will receive the imaginary part.
Returns:
BOOL with TRUE if conversion was successful. When conversion fails it returns FALSE.
See also:
sat3_convertcplx_decn sat3_convertcplx_dbl sat3_convertcplx_int sat3_convertcplx_llong Object creation and manipulation
SAT_OBJECT sat3_createcplx_dbl ( SAT_OBJECT  where,
double  real,
double  imag 
)

Create a complex from two double's (real and imaginary parts).

This function creates a complex object from a pair of double's.

Parameters:
whereDefines where to allocate memory from. Can be one of the following constants: ALLOC_HEAP Allocates from the C-heap using malloc() ALLOC_TEMPOB Allocates memory from the TEMPOB calculator area or... it can be an element (SAT_OBJECT) within a composite object, (array, list or any other).
realValue to assign to the real part.
imagValue to assign to the imaginary part.
Returns:
SAT_OBJECT with the new complex number, or zero if it fails. When a SAT_OBJECT is given to the 'where' parameter, the same SAT_OBJECT is returned or 0 if error.
See also:
sat3_createcplx_xreal sat3_createcplx_decn sat3_createcplx_int sat3_createcplx_llong Object creation and manipulation
SAT_OBJECT sat3_createcplx_decn ( SAT_OBJECT  where,
decNumber real,
decNumber imag 
)

Create a complex from variable precision real numbers (decNumber).

This function creates a complex object from two decNumber's (real and imaginary parts).

Parameters:
whereDefines where to allocate memory from. Can be one of the following constants: ALLOC_HEAP Allocates from the C-heap using malloc() ALLOC_TEMPOB Allocates memory from the TEMPOB calculator area or... it can be an element (SAT_OBJECT) within a composite object, (array, list or any other).
realValue to assign to the real part.
imagValue to assign to the imaginary part.
Returns:
SAT_OBJECT with the new complex number, or zero if it fails. When a SAT_OBJECT is given to the 'where' parameter, the same SAT_OBJECT is returned, or zero if it fails.
See also:
sat3_createcplx_xreal sat3_createcplx_dbl sat3_createcplx_int sat3_createcplx_llong Object creation and manipulation
SAT_OBJECT sat3_createcplx_int ( SAT_OBJECT  where,
int  real,
int  imag 
)

Create a complex from two integers.

This function creates a complex object from two 32-bit integer.

Parameters:
whereDefines where to allocate memory from. Can be one of the following constants: ALLOC_HEAP Allocates from the C-heap using malloc() ALLOC_TEMPOB Allocates memory from the TEMPOB calculator area or... it can be an element (SAT_OBJECT) within a composite object, (array, list or any other).
realValue to assign to the real part.
imagValue to assign to the imaginary part.
Returns:
SAT_OBJECT with the new complex number, or zero if it fails. When a SAT_OBJECT is given to the 'where' parameter, the same SAT_OBJECT is returned or 0 if error.
See also:
sat3_createcplx_xreal sat3_createcplx_decn sat3_createcplx_dbl sat3_createcplx_llong Object creation and manipulation
SAT_OBJECT sat3_createcplx_llong ( SAT_OBJECT  where,
LONGLONG  real,
LONGLONG  imag 
)

Create a complex from two LONGLONG integers (real and imaginary parts).

This function creates a complex object from two 64-bit integer (LONGLONG).

Parameters:
whereDefines where to allocate memory from. Can be one of the following constants: ALLOC_HEAP Allocates from the C-heap using malloc() ALLOC_TEMPOB Allocates memory from the TEMPOB calculator area or... it can be an element (SAT_OBJECT) within a composite object, (array, list or any other).
realValue to assign to the real part.
imagValue to assign to the imaginary part.
Returns:
SAT_OBJECT with the new complex number, or zero if it fails. When a SAT_OBJECT is given to the 'where' parameter, the same SAT_OBJECT is returned or 0 if error.
See also:
sat3_createcplx_xreal sat3_createcplx_decn sat3_createcplx_dbl sat3_createcplx_int Object creation and manipulation
SAT_OBJECT sat3_createcplx_xreal ( SAT_OBJECT  where,
XREAL real,
XREAL imag 
)

Create a complex from extended precision real numbers (XREAL).

This function creates a complex object from an XREAL number.

Parameters:
whereDefines where to allocate memory from. Can be one of the following constants: ALLOC_HEAP Allocates from the C-heap using malloc() ALLOC_TEMPOB Allocates memory from the TEMPOB calculator area or... it can be an element (SAT_OBJECT) within a composite object, (array, list or any other).
realValue to assign to the real part of the complex number.
imagValue to assign to the imaginary part of the complex number.
Returns:
SAT_OBJECT with the new complex number, or zero if it fails. When a SAT_OBJECT is given to the 'where' parameter, the same SAT_OBJECT is returned, or zero if it fails.
See also:
sat3_createcplx_decn sat3_createcplx_dbl sat3_createcplx_int sat3_createcplx_llong Object creation and manipulation