Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_exception_value.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_exception_value.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_exception_value.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_exception_value.html on line 8
Get the value of the current exception registers
#include <fpstatus.h>
int fp_exception_value( int mask );
- mask
- A mask whose bits indicate which registers you want the value of.
The bits include:
- _FP_EXC_INVALID
- _FP_EXC_DIVZERO
- _FP_EXC_OVERFLOW
- _FP_EXC_UNDERFLOW
- _FP_EXC_INEXACT
- _FP_EXC_DENORMAL
libm
Use the -l m option to
qcc
to link against this library.
The fp_exception_value() function
gets the value of the current exception registers.
Set bits indicate that the exception has signaled,
unset bits indicate that the exception hasn't signaled.
The value of the current exception registers based on the values
from <fpstatus.h>.
|
This function doesn't return a special value to indicate that an error
occurred.
If you want to check for errors, set
errno
to 0, call the function, and then check errno again. |
#include <fpstatus.h>
int main(int argc, char** argv)
{
int ret;
/* Test to see if an operation has set (but not necessarily
* signaled depending on the exception mask) the
* division by zero bit:
*/
if (fp_exception_value(_FP_EXC_DIVZERO) & _FP_EXC_DIVZERO)
printf("Division by zero has occurred \n");
else
printf("Division by zero has not occurred \n");
return(0);
}
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
fp_precision(),
fp_rounding(),
fp_exception_mask(),
fp_setenv()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_exception_value.html on line 180
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/f/fp_exception_value.html on line 180