HPGCC3 Documentation 3.0 R003

Real functions

Functions

SAT_OBJECT sat3_createreal_xreal (SAT_OBJECT where, XREAL *value)
 Create a real from extended precision real numbers (XREAL).
BOOL sat3_convertreal_xreal (SAT_OBJECT real, XREAL *result)
 Convert a real into an extended precision real (XREAL).
SAT_OBJECT sat3_createreal_decn (SAT_OBJECT where, decNumber *value)
 Create a real from variable precision real numbers (decNumber).
BOOL sat3_convertreal_decn (SAT_OBJECT real, decNumber *result)
 Convert a real into a variable precision real (decNumber).
SAT_OBJECT sat3_createreal_dbl (SAT_OBJECT where, double value)
 Create a real from double.
double sat3_convertreal_dbl (SAT_OBJECT real)
 Convert a real into a double.
SAT_OBJECT sat3_createreal_int (SAT_OBJECT where, int value)
 Create a real from an int.
int sat3_convertreal_int (SAT_OBJECT real)
 Convert a real into a 32-bit int.
SAT_OBJECT sat3_createreal_llong (SAT_OBJECT where, LONGLONG value)
 Create a real from a LONGLONG.
LONGLONG sat3_convertreal_llong (SAT_OBJECT real)
 Convert a real into a 64-bit int.

Detailed Description

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


Function Documentation

double sat3_convertreal_dbl ( SAT_OBJECT  real)

Convert a real into a double.

This function converts a real object to a double.

Parameters:
realA SAT_OBJECT real number.
Returns:
double with the given real number. When conversion fails it returns 0.0.
See also:
sat3_convertreal_decn sat3_convertreal_int sat3_convertreal_llong sat3_convertreal_xreal Object creation and manipulation
BOOL sat3_convertreal_decn ( SAT_OBJECT  real,
decNumber result 
)

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

This function converts a real object to a decNumber.

Parameters:
realA SAT_OBJECT real number.
resultPointer to a previously allocated decNumber. 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_convertreal_dbl sat3_convertreal_int sat3_convertreal_llong sat3_convertreal_xreal Object creation and manipulation
int sat3_convertreal_int ( SAT_OBJECT  real)

Convert a real into a 32-bit int.

This function converts a real object to an int. Fractional part is discarded (no rounding).

Parameters:
realA SAT_OBJECT real number.
Returns:
int with the given real number. When conversion fails it returns 0.
See also:
sat3_convertreal_decn sat3_convertreal_dbl sat3_convertreal_llong sat3_convertreal_xreal Object creation and manipulation
LONGLONG sat3_convertreal_llong ( SAT_OBJECT  real)

Convert a real into a 64-bit int.

This function converts a real object to a LONGLONG integer. Fractional part is discarded (no rounding).

Parameters:
realA SAT_OBJECT real number.
Returns:
LONGLONG with the given real number. When conversion fails it returns 0.
See also:
sat3_convertreal_decn sat3_convertreal_dbl sat3_convertreal_int sat3_convertreal_xreal Object creation and manipulation
BOOL sat3_convertreal_xreal ( SAT_OBJECT  real,
XREAL result 
)

Convert a real into an extended precision real (XREAL).

This function converts a real object to an XREAL.

Parameters:
realA SAT_OBJECT real number.
resultPointer to a previously allocated XREAL.
Returns:
BOOL with TRUE if conversion was successful. When conversion fails it returns FALSE.
See also:
sat3_convertreal_dbl sat3_convertreal_int sat3_convertreal_llong sat3_convertreal_decn Object creation and manipulation
SAT_OBJECT sat3_createreal_dbl ( SAT_OBJECT  where,
double  value 
)

Create a real from double.

This function creates a real object from a double.

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).
valueInitial value to assign to the newly created real.
Returns:
SAT_OBJECT with the new real 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_createreal_decn sat3_createreal_int sat3_createreal_llong sat3_createreal_xreal Object creation and manipulation
SAT_OBJECT sat3_createreal_decn ( SAT_OBJECT  where,
decNumber value 
)

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

This function creates a real object from a decNumber.

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).
valueInitial value to assign to the newly created real.
Returns:
SAT_OBJECT with the new real 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_createreal_dbl sat3_createreal_int sat3_createreal_llong sat3_createreal_xreal Object creation and manipulation
SAT_OBJECT sat3_createreal_int ( SAT_OBJECT  where,
int  value 
)

Create a real from an int.

This function creates a real object from a 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).
valueInitial value to assign to the newly created real.
Returns:
SAT_OBJECT with the new real 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_createreal_decn sat3_createreal_dbl sat3_createreal_llong sat3_createreal_xreal Object creation and manipulation
SAT_OBJECT sat3_createreal_llong ( SAT_OBJECT  where,
LONGLONG  value 
)

Create a real from a LONGLONG.

This function creates a real object from a 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).
valueInitial value to assign to the newly created real.
Returns:
SAT_OBJECT with the new real 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_createreal_decn sat3_createreal_dbl sat3_createreal_int sat3_createreal_xreal Object creation and manipulation
SAT_OBJECT sat3_createreal_xreal ( SAT_OBJECT  where,
XREAL value 
)

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

This function creates a real 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).
valueInitial value to assign to the newly created real.
Returns:
SAT_OBJECT with the new real number, or zero if it fails. When a SAT_OBJECT is given to the 'where' parameter, the same SAT_OBJECT is returned.
See also:
sat3_createreal_dbl sat3_createreal_int sat3_createreal_llong sat3_createreal_decn Object creation and manipulation