[Cfp-interest 1670] Re: intmax_t removal

Jim Thomas jaswthomas at sbcglobal.net
Thu Jun 25 17:37:30 PDT 2020


Fred, I sent my draft changes before seeing this message.

> On Jun 25, 2020, at 4:44 PM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> On Thu, 25 Jun 2020 10:12:18 -0700 Jim Thomas wrote:
>> 
>> "or rounds to an integral value that is outside the range of any supported integer type of the specified width" seems wrong (at best ambiguous). Is -2 outside the range of any integer type of width 32? What if there is no supported type of the specified width? Better might be something like " or rounds to an integral value that is outside the range of integers (signed or unsigned, respectively) of the specified width, ".
> 
> Your text is better.  Done.
> 
> 
>> If we change the return type to floating, we can do better than return an unspecified value. I'll send suggestions in a subsequent message.
> 
> I added words to return a NaN (if available), else, HUGE_VAL.

My draft had "the functions return an unspecified value outside the range”, which won’t do (because it doesn’t preclude returning something that would round to an in range value). Yours seems better, except for HUGE_VAL. It would be better if a subsequent cast or assignment to the integer type for the width would be given an error case. For large enough width, HUGE_VAL could be an in range value. How about returning the value of x if a NaN is not available?

- Jim Thomas

> 
> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> tydeman at tybor.com      Testing, numerics, programming
> +1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
> Sample C99+FPCE tests: http://www.tybor.com
> Savers sleep well, investors eat well, spenders work forever.




More information about the Cfp-interest mailing list