[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gawk: Locale-dependant bug with string to floating point conversion
From: |
Paul Eggert |
Subject: |
Re: gawk: Locale-dependant bug with string to floating point conversion |
Date: |
Sun, 02 May 2004 20:22:54 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Aharon Robbins <address@hidden> writes:
> Paul, it would help if you'd actually read the rest of that item:
I did. You're correct in that the rest of that item makes it clear
that all integer-constants are decimal, because of (1), (2), and (3)
(quoted again below). However, there's only one restriction about
floating-constants, namely (4), and this restriction does not outlaw
hexadecimal floating-constants. Therefore, the 2004 POSIX awk spec
requires support for hexadecimal floating-constants.
Here's the chapter and verse again, for your convenience.
The token NUMBER shall represent a numeric constant. Its form and numeric
value shall be equivalent to either of the tokens floating-constant or
integer-constant as specified by the ISO C standard, with the following
exceptions:
1. An integer constant cannot begin with 0x or include the hexadecimal
digits 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'A' , 'B' , 'C' , 'D' ,
'E' , or 'F' .
2. The value of an integer constant beginning with 0 shall be taken in
decimal rather than octal.
3. An integer constant cannot include a suffix ( 'u' , 'U' , 'l' ,
or 'L' ).
4. A floating constant cannot include a suffix ( 'f' , 'F' , 'l' ,
or 'L' ).
If the value is too large or too small to be representable (see Concepts
Derived from the ISO C Standard ), the behavior is undefined.