[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: |
Aharon Robbins |
Subject: |
Re: gawk: Locale-dependant bug with string to floating point conversion |
Date: |
Sun, 2 May 2004 17:06:09 +0300 |
Paul says POSIX says that awk supports hexadecimal numbers.
I say show me.
Paul cites the current standard, and says:
> 2. That same spec under "Lexical conventions" says that a NUMBER
> shall be equivalent to either a C99 floating-constant or
> integer-constant, except that a floating-constant can't include a
> suffix (f, F, l, L), and some other restrictions about
> integer-constants.
Paul, it would help if you'd actually read the rest of that item:
| 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.
This seems pretty clear to me that all numbers in awk are decimal.
Case closed.
Arnold
- Re: gawk: Locale-dependant bug with string to floating point conversion,
Aharon Robbins <=