HP MLIB User's Guide Vol. 2 7th Ed.
Chapter 12 VMATH 801
Get, set, and clear error status for VMATH functions vmlGetErrStatus, vmlSetErrStatus, vmlClearErrStatus
Name vmlGetErrStatus, vmlSetErrStatus, vmlClearErrStatus
Get, set, and clear error status for VMATH functions
Purpose vmlGetErrStatus returns the current error status for VMATH functions.
vmlSetErrStatus sets the new error status for VMATH functions according to
the err parameter and returns the error status in effect at the time of the call.
vmlClearErrStatus sets the new error status for VMATH functions to
VML_STATUS_OK and returns the error status in effect at the time of the call.
The error status is specified by one of the macros:
The err parameter for vmlSetErrStatus must have the value of one of the error
status macros. Each of these functions returns the value of one of the error
status macros.
Example
The following checks whether a call to vdExp is free of errors:
unsigned int err;
vmlClearErrStatus();
vdExp(n,a,y);
err = vmlGetErrStatus();
if (err == VML_STATUS_OK) {
// no errors
...
}
else {
// handle errors
...
}
NOTE The error status represents just one error condition, though more than
one may occur in a vector math function call. The floating-point
VML_STATUS_OK No errors
VML_STATUS_BADSIZE Array dimension is not positive
VML_STATUS_BADMEM NULL pointer argument
VML_STATUS_ERRDOM Function undefined for some array element
VML_STATUS_SING Singularity at some array element
VML_STATUS_OVERFLOW Floating-point overflow occurred
VML_STATUS_UNDERFLOW Floating-point underflow occurred