Floating point trap handling -- is it possible?

Walter Bright newshound at digitalmars.com
Mon Jul 24 03:18:29 PDT 2006


Don Clugston wrote:
> I notice that the in the D docs, and in std.c.fenv, there is no mention 
> of floating-point trap handling. Is it even feasible to handle traps in 
> a portable manner?

Not any better than you can in C.

> I have no idea if this is feasible across the OSes supported by D; for 
> example, it requires that the OS save the floating point exception 
> handler states between threads. Walter once made a comment that 
> signalling NaNs are poorly supported by OSes; is trap handling the reason?

I've generally just stuck with reading the sticky floating point 
exception flags.



More information about the Digitalmars-d mailing list