manpagez: man pages & more
info gawk
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

D.3.3 Standards Versus Existing Practice

Historically, awk has converted any non-numeric looking string to the numeric value zero, when required. Furthermore, the original definition of the language and the original POSIX standards specified that awk only understands decimal numbers (base 10), and not octal (base 8) or hexadecimal numbers (base 16).

Changes in the language of the 2001 and 2004 POSIX standard can be interpreted to imply that awk should support additional features. These features are:

The first problem is that both of these are clear changes to historical practice:

The second problem is that the gawk maintainer feels that this interpretation of the standard, which requires a certain amount of “language lawyering” to arrive at in the first place, was not even intended by the standard developers. In other words, “we see how you got where you are, but we don’t think that that’s where you want to be.”

The 2008 POSIX standard added explicit wording to allow, but not require, that awk support hexadecimal floating point values and special values for “Not A Number” and infinity.

Although the gawk maintainer continues to feel that providing those features is inadvisable, nevertheless, on systems that support IEEE floating point, it seems reasonable to provide some way to support NaN and Infinity values. The solution implemented in gawk is as follows:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.