[Cfp-interest 2732] Re: comparison macros and exceptions due to conversion to the semantic type

Jim Thomas jaswthomas at sbcglobal.net
Mon Mar 27 21:01:25 PDT 2023



> On Mar 27, 2023, at 8:03 PM, Vincent Lefevre <vincent at vinc17.net> wrote:
> 
> In N3088, 7.12.17 "Comparison macros" has note 302:
> 
>  Whether an argument represented in a format wider than its
>  semantic type is converted to the semantic type is unspecified.

This is unfortunate. I’m guessing it got implemented both ways before the lack of specification was noticed, and the current statement just acknowledges the situation.

> 
> and 7.12.17.6 "The isunordered macro" says
> 
>  It raises no floating-point exceptions if neither argument is a
>  signaling NaN.
> 
> Now, if a conversion to the semantic type with the isunordered macro
> yields an underflow or an overflow, is this exception expected to be
> signaled? This seems unclear.

I think the intention is that if the argument is represented in wider format and is converted to semantic type, then any overflow or underflow resulting from the conversion would be signaled. Such a conversion may be considered to be prior to the comparison (similar to argument conversion for a function). If the argument is not converted to semantic type, then overflow and underflow would not occur.

- Jim Thomas

> 
> Then, same question for the other comparison macros.
> 
> -- 
> Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest




More information about the Cfp-interest mailing list