Mail Archives: djgpp-workers/2003/03/31/15:27:57
> Date: Mon, 31 Mar 2003 19:50:07 +0100
> From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
>
> The code in _doprnt (well, cvtl and isspeciall) works with floats stored in
> long doubles. When you do, say:
>
> printf("%f", NAN);
>
> the NAN is first converted in _doprnt to a double by the va_arg macro, then to
> a long double.
>
> So NAN does not appear as "nan" or "nan(0x7fffff)", as you might expect. It
> appears as "nan(0xffffff00000000)".
If indeed there's no format specifier for a float (I don't have time
to dig into C9x, but I thought there was something like %hf, no?),
then it would at least be nice to be able to distinguish between a
double and a long double NaN.
So how about some code that would detect NaNs early on, before they
are converted to a long double?
- Raw text -