This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/_fpreset.c

27 lines
746 B
C

#include <stdio.h>
#include <float.h>
char *status[2] = { "No", " " };
void main()
{
unsigned int fp_status;
fp_status = _status87();
printf( "80x87 status\n" );
printf( "%s invalid operation\n",
status[ (fp_status & SW_INVALID) == 0 ] );
printf( "%s denormalized operand\n",
status[ (fp_status & SW_DENORMAL) == 0 ] );
printf( "%s divide by zero\n",
status[ (fp_status & SW_ZERODIVIDE) == 0 ] );
printf( "%s overflow\n",
status[ (fp_status & SW_OVERFLOW) == 0 ] );
printf( "%s underflow\n",
status[ (fp_status & SW_UNDERFLOW) == 0 ] );
printf( "%s inexact result\n",
status[ (fp_status & SW_INEXACT) == 0 ] );
_fpreset();
}