bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Handling hexadecimals in different modes


From: arnold
Subject: Re: [bug-gawk] Handling hexadecimals in different modes
Date: Tue, 08 Sep 2015 07:34:12 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Jarno Suni <address@hidden> wrote:

> On Mon, 31 Aug 2015 22:56:18 +0300
> Jarno Suni <address@hidden> wrote:
>
> But if you want to write portable scripts, strtonum() is hard to
> recommend as it is not found in other awk implementation AFAIK.

The gawk doc includes an awk implementatin of strtonum that can
be used with other awks, so the above isn't an issue.

> Could gawk be changed so that with hexadecimal numbers, conversion
> would work even without non-decimal-data option or posix option?

No.

> Then it would work the same way as other awk implementations I have tested
> (i.e. mawk and original-awk in Ubuntu Linux).

This is accidental, since those versions just call strtod and GLIBC
strtod handles hex values.  This is discussed somewhat in the gawk
doc.  The upshot is that you cannot rely on that behavior on non-GLIBC
systems.

Arnold



reply via email to

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