Mail Archives: djgpp-workers/2002/12/18/08:04:52
Hello.
Eli Zaretskii wrote:
>
> On Wed, 18 Dec 2002, Richard Dawe wrote:
>
> > > > Test 6: Inf -> 0
> > >
> > > Why doesn't this return an Inf (the float representation of it)?
> >
> > Because strtof does not parse Inf. strtod and strtold do not either.
>
> Does that mean our printf can generate Inf and NaN, but our scanf cannot
> read them? Oops!
Yes. Looking at the code, it seems that sscanf(sprintf(x)) != x for x ==
INFINITY or x == NAN.
> > C99 requires strto* to understand Inf and NaN (and other capitalisations).
> > I think we can fix those problems in another round of C99-compliance work.
>
> I think we should indeed fix that. How about adding this to TODO?
Done. I've created a page for C99 compliance issues:
http://www.phekda.freeserve.co.uk/richdawe/djgpp/2.04/c99-204.html
I thought my main DJGPP 2.04 page would be too full, if I added them to it.
This C99 compliance page referenced from my DJGPP 2.04 page:
http://www.phekda.freeserve.co.uk/richdawe/djgpp/2.04/status204.html
> > > Also, what about a NaN?
> >
> > I can add a test for NaNs, if that's what you are asking.
>
> Yes. If we don't support converting Inf, we probably don't support NaN
> either, so this is also something to be fixed, IMHO. (There's also the
> new C99 complication with NaN-0xFFFFFF.... thingie.)
OK, I will add a test for a NaN, but it won't work for now...
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -