Re: Signaling NaNs

2021-12-10 Thread Bruno Haible
Marc Nieper-Wißkirchen wrote: > I could reformulate my question to: "Is there a way to produce a (quiet) > NaN that won't occur as a result of the C library functions?" There are 2^51 possible quiet NaNs [1]. I would guess that the hardware and libc functions produce only a small portion of this s

Re: Signaling NaNs

2021-12-09 Thread Marc Nieper-Wißkirchen
; > find it: Does Gnulib offer a way to store a signaling NaN in a memory > > location (if supported by the platform) > > It doesn't, because quiet NaNs are easier to work with. > > > The forthcoming C2x standard will have FLT_SNAN, DBL_SNAN, and LDBL_SNAN, > >

Re: Signaling NaNs

2021-12-09 Thread Bruno Haible
ming C2x standard will have FLT_SNAN, DBL_SNAN, and LDBL_SNAN, > but before that there doesn't seem to be a portable way to get signaling > NaNs. ... indeed, when you have a non-optimizing compiler, how to prevent the compiler from generating instructions that produce a floating-point excep

Signaling NaNs

2021-12-09 Thread Marc Nieper-Wißkirchen
ndard will have FLT_SNAN, DBL_SNAN, and LDBL_SNAN, but before that there doesn't seem to be a portable way to get signaling NaNs. In case the following problem is easier: What I really need is a bit pattern for a double that won't be returned by the usual floating-point functions. Thanks, Marc