 | C166 User's Guide |  |
|
|
| _chkdouble_| Summary | | | Description | The _chkdouble_ function checks the status of the floating-point number val. | | Return Value | The _chkdouble_ function returns the status of the floating-point number val: | Return Value | Meaning |
|---|
| 0 | Standard floating-point number. | | 1 | Floating-point value 0. | | 2 | +INF (positive overflow). | | 3 | -INF (negative overflow). | | 4 | NaN (Not a Number) error status. |
| | See Also | _chkfloat_ | | Example |
#include <intrins.h>
#include <stdio.h> /* for printf */
float f1, f2, f3;
void tst_chkdouble (void) {
f1 = f2 * f3;
switch (_chkdouble_ (f1)) {
case 0:
printf ("result is a number\n"); break;
case 1:
printf ("result is zero\n"); break;
case 2:
printf ("result is +INF\n"); break;
case 3:
printf ("result is -INF\n"); break;
case 4:
printf ("result is NaN\n"); break;
}
}
|
|
|