bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Gawk - problem with hexadecimal numbers


From: Aharon Robbins
Subject: Re: Gawk - problem with hexadecimal numbers
Date: Fri, 17 Feb 2006 12:40:09 +0200

Greetings. I cannot reproduce this under Fedora Core 2 with either
gawk 3.1.4 or 3.1.5. I get the correct answer of 14.

Did you compile this yourself from sources? If not, you might
try that with the current version.

Also, what kind of locale settings do you have? That shouldn't be
an issue, but one never knows.

Thanks,

Arnold

> Date: Tue, 14 Feb 2006 15:28:15 +0100
> From: address@hidden
> Subject: Gawk - problem with hexadecimal numbers
> To: address@hidden
>
> Dear GNU,
>       I have some problems with the strtonum() gawk function with hexadecimal
> numbers.  After a number of trials, the problem narrows down to the presence
> of the digit "e" in the number.  The small example below shows that it is not
> recognised while the other digits work OK.  The same happens with a longer
> hex number when it contains a "e".
> Could there be some confusion with the "e" marking the exponent in floating
> numbers ?
>
> Thank's for your help.
>
> Regards,
>             Pierrik Vuilleumier
>
>
> The problem =======================
> echo 0xf | awk '{print strtonum($1)}'
> 15
> echo 0xe | awk '{print strtonum($1)}'
> 0
>
> The gawk version =========================
> /usr/bin> gawk --version
> GNU Awk 3.1.4
> Copyright (C) 1989, 1991-2003 Free Software Foundation.
>
> This program is free software; you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> the Free Software Foundation; either version 2 of the License, or
> (at your option) any later version.
>
> This program is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> along with this program; if not, write to the Free Software
> Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
>
>
> /usr/bin> ldd -r gawk
>         linux-gate.so.1 =>  (0xffffe000)
>         libdl.so.2 => /lib/libdl.so.2 (0x40030000)
>         libm.so.6 => /lib/tls/libm.so.6 (0x40035000)
>         libc.so.6 => /lib/tls/libc.so.6 (0x40058000)
>         /lib/ld-linux.so.3 => /lib/ld-linux.so.2 (0x40000000)
>
>
> The SusE 9.3  platform =================================
> /usr/bin> uname -a
> Linux proba-ips 2.6.8-24.19-smp #1 SMP Tue Nov 29 14:32:45 UTC 2005 i686 i686
> i386 GNU/Linux




reply via email to

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