[Cfp-interest 2339] Re: nan("1111111111111111111111....")

Vincent Lefevre vincent at vinc17.net
Mon Jan 17 01:18:38 PST 2022


On 2022-01-16 20:41:13 -0800, Fred J. Tydeman wrote:
> On Mon, 17 Jan 2022 03:07:04 +0100 Vincent Lefevre wrote:
> >
> >Finding which integers yield a FP_INVALID could give some idea...
> >If this occurs only for i >= 2^64, that's probably STRTOULL.
> 
> My mis-remembering.
> It is errno gets set to ERANGE and no FP flags are raised.

It is required to set errno to ERANGE and does not have to raise
any FP flags.

Then 7.6p3 says

  a function call is assumed to have the potential for raising
  floating-point exceptions, unless its documentation promises
  otherwise.

(that's the usual "programming convention", you should check
the ABI for the actual requirements).

-- 
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)


More information about the Cfp-interest mailing list