Operating System - OpenVMS
1827998 Members
2846 Online
109973 Solutions
New Discussion

Re: How to Turn Off Floating-Point Exception Interruption

 
Ray Lu
Occasional Contributor

How to Turn Off Floating-Point Exception Interruption

If I have overflowed floating-point values in my program, the program is interrupted and floating-point value exception message is returned. Is there any way to turn off this exception handling, like a compiler option or system function?

I'm running on a OpenVMS Alpha system. I mainly care about VAX floating-point types. I've tried cc option /PDSC_MASK=SILENT but saw no difference. I believe there's no such systerm functions as feholdexcept() on Unix to turn off exception complaint. My short test program is attached below.

Thanks for helping me.

Ray

------------------
#include
#include

int main(void)
{
int i, j;
double d;
unsigned char *dp = (unsigned char*)&d;
float f;

for (i=0; i<16; i++) {
for (j=0; j dp[j] = rand();
f = (float)d;
printf("f=%g\n", (float)f);
}

return 0;
}
1 REPLY 1
Ray Lu
Occasional Contributor

Re: How to Turn Off Floating-Point Exception Interruption

Made two submissions. Close this one.