delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/12/18/01:14:54

Date: Wed, 18 Dec 2002 08:07:06 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
cc: djgpp-workers AT delorie DOT com
Subject: Re: strtof (C99) [PATCH]
In-Reply-To: <3DFFC69E.693C6E55@phekda.freeserve.co.uk>
Message-ID: <Pine.SUN.3.91.1021218080406.4677D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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!

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

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

- Raw text -


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