[Cfp-interest] exceptional macro

Mike Cowlishaw mfc at speleotrove.com
Wed May 14 02:01:48 PDT 2014


 
>  FE_EXCEPTIONAL( expression or compound statement, 
>                  exception1, exception2, ...)

Rather than having the multiple arguments, perhaps it could be simply

  FE_EXCEPTIONS( expression )

which returns the exceptions raised in the evaluation of the expression (or
compound statement if that's allowed), ORed together.  (Assuming the exceptions
& subexpressions are defined to be bit-unique.) 


Then one might write:

  if (FE_EXCEPTIONS( p/q | FE_UNDERFLOW )) {whatever}

or

  x = FE_EXCEPTIONS( a=p/q | FE_UNDERFLOW ) ? a : sNAN ;

etc.

Mike



More information about the Cfp-interest mailing list