set_status¶
Sets the global VM Status according to new values and returns the previous VM Status.
Syntax
-
uint8_t
set_status
(queue &exec_queue, uint_8 new_status)¶
Description
The set_status function sets the global VM Status to new value and returns the previous VM Status.
The global VM Status is a single value and it accumulates via bitwise OR ( | ) all errors that happen inside VM functions. The following table lists the possible error values.
Status |
Description |
---|---|
Successful Execution |
|
|
VM function execution completed successfully |
|
VM status not defined |
Warnings |
|
|
VM function execution completed successfully in a different accuracy mode |
Computational Errors |
|
|
Values are out of a range of definition producing invalid (QNaN) result |
|
Values cause divide-by-zero (singularity) errors and produce and invalid (QNaN or Inf) result |
|
An overflow happened during the calculation process |
|
An underflow happened during the calculation process |
Input Parameters
- exec_queue
The queue where the routine should be executed.
- new_status
Specifies the VM status to be set.
Output Parameters
- return value (old_status)
Specifies the former VM status.
Example
uint8_t olderr = set_status (exec_queue, status::success);
if (olderr & status::errdom)
{
std::cout << ”Errdom status returned” << std::endl;
}
if (olderr & status::sing)
{
std::cout << ”Singularity status returned” << std::endl;
}
Parent topic: VM Service Functions