delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/12/18/08:04:52

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3E007233.784010EE@phekda.freeserve.co.uk>
Date: Wed, 18 Dec 2002 13:03:47 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: strtof (C99) [PATCH]
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1021218080406 DOT 4677D-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019