[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A bug or a mis-feature ?
From: |
Andreas Jaeger |
Subject: |
Re: A bug or a mis-feature ? |
Date: |
19 Apr 2001 10:43:35 +0200 |
User-agent: |
Gnus/5.090003 (Oort Gnus v0.03) XEmacs/21.1 (Channel Islands) |
Mario Stipcevic <address@hidden> writes:
> Hi there !
>
> I foun (the hard way) that atof() and strtod() functions in gcc 2.91.66
> and 2.95.2 have an inetersting "feature" (or a bug) that was not
> present in
> older compilers (say 2.7.2.3) and is mostprobably NOT TO THE ANSI
> standard.
atof is part of glibc not part of the compiler.
> In short:
>
> atof("infXXXX") returns a big nuumber instead of zero. This is
> disturbing since if I have any string beginning with "inf" I will
> get a non-zero return from atof(). The same goes for
> strtod("infXXX",'\0').
Did you read my private email about ISO C99? ISO C99 mandates that
atof ("infANYTHING") returns inf. There's no point in discussing
this, glibc follows the standard.
Andreas
--
Andreas Jaeger
SuSE Labs address@hidden
private address@hidden
http://www.suse.de/~aj