[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk infinity issues

From: Aharon Robbins
Subject: Re: gawk infinity issues
Date: Fri, 06 Jan 2006 05:53:14 +0200

> Date: Thu, 05 Jan 2006 18:18:31 -0500
> From: "Andrew J. Schorr" <address@hidden>
> Subject: Re: gawk infinity issues
> To: Paul Eggert <address@hidden>
> Cc: address@hidden
> On Thu, Jan 05, 2006 at 02:53:33PM -0800, Paul Eggert wrote:
> > POSIX doesn't say what should happen with infinities or NaNs, so Awk
> > can do as it pleases.
> > 
> > The C99 Standard says that printf can print either "inf" or
> > "infinity"; it's implementation-defined.  Similarly, NaNs are printed
> > as either "nan" or "nan(n-char-sequence)".  In either case, "-" is
> > prepended if the sign bit is negative.
> > 
> > Presumably Awk should do the same as C99.  However, I don't think it's
> > a big deal if Awk does something different on old-fashioned hosts like
> > Solaris 8 that don't have proper C99 support.
> Understood.  But it still seems to me that gawk should have a clear policy
> (even if not defined by POSIX) on how it will convert to a number a string
> that contains a (platform-dependent) representation of Infinity or NaN.  
> Or do you feel that this behavior need not be nailed down?
> Regards,
> Andy

Hi All.  This case is definitely one to leave as "not nailed down". There
are too many systems, with too many variations in the underlying
libraries, for gawk to be able to (easily) do something that is portable,
works everywhere, and is maintainable.

All that said, I'd happily accept a documentation patch, probably in Appendix
A which talks about floating point issues and such, discussing some of
these issues.

Also, if something reasonable for gawk_strtod() can be done, I'd probably
accept a patch there too.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]