tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: standards on SIGFPE for divide by zero?



On 2/28/11 12:38 PM, Greg Troxel wrote:
   My question is:  what do the relevant standards say about this?  Is it
   required to SIGFPE?  If it's required, I'll file a PR against
   port-powerpc and mark the tests expected-fail on ppc.  If not, then
   I'll skip them on ppc.

I dimly recall that it's required to be able to set this mode, but that
it doesn't have to be the default.  I think this is controlled by
IEEE754, but note that vax is different.

See fpgetmask(3).  Maybe the test should set FP_X_DZ.

Someone else pointed me there, but perhaps I'm using it wrong... after doing
fpsetmask(FP_X_DZ);
The only thing different is that "1.0/0.0" prints "0" instead of "inf".  :/


Regardless of standards, it's probably good for NetBSD to be consistent
across ports on default fp behavior.

I agree, but am willing to yield to more experienced heads on this.

+j




Home | Main Index | Thread Index | Old Index