[cfp-interest 3581] Re: llquantexp(infinity)

Jim Thomas jaswthomas at sbcglobal.net
Mon Sep 1 11:22:53 PDT 2025


It’s an “invalid” operation. Per ISO/IEC 60559, "there is no usefully definable result." I believe the result was chosen to reflect that, with the dubious idea that LLONG_MIN might be a minuscule better error notice than LLONG_MAX. But C hasn’t been consistent in defining return values for “invalid” floating-point operations that return values in integer types. I don’t think it would be good to change this. That would break implementations and might break programs.

It’s already a domain error.

- Jim Thomas

> On Aug 30, 2025, at 8:08 PM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> Given that llquantexpdN(max finite) is a large positive integer,
> it seems to me that llquantexpdN(infinity) should be LLONG_MAX
> (not LLONG_MIN) and be a domain error.
> 
> IEEE 754-2019 says in 5.3.2: quantum(infinity) is +infinity.
> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> tydeman at tybor.com      Testing, numerics, programming
> +1 (702) 608-6093      Vice-chair of INCITS/C (ANSI "C")
> Sample C17+FPCE tests: http://www.tybor.com
> Savers sleep well, investors eat well, spenders work forever.
> 
> _______________________________________________
> 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