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

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

Re: gawk printf format problem with negative numbers


From: Aharon Robbins
Subject: Re: gawk printf format problem with negative numbers
Date: Tue, 28 Oct 2003 20:08:19 +0200

Greetings. Re this:

> From: "Shaffer, Kenneth" <address@hidden>
> To: "'address@hidden'" <address@hidden>
> Subject: gawk printf format problem with negative numbers
> Date: Tue, 28 Oct 2003 11:53:35 -0500
>
> I expected the output of a negative 1234 in hex to look like 0xfffffb2e:
>  
> > echo |gawk '{n = -1234; printf("0x%x\n",n+0)}'
> 0x-1234
>
> > gawk --version
> GNU Awk 3.1.3
>  
> running under cygwin for the PC.

        Fascinating, Captain.
                --- Mr. Spock

I don't see this on my system, Redhat 8 Linux:

        $ echo | gawk-3.1.3 '{n = -1234; printf("0x%x\n",n+0)}'
        0xfffffffffffffb2e
        $ gawk-3.1.3 'BEGIN {n = -1234; printf("0x%x\n",n+0)}'
        0xfffffffffffffb2e

I get the same behavior in my development version as well.

What system and compiler are you using?  Are you able to track
this down?  If not, then maybe we can arrange offline for me
to have ssh access to your system to debug it.

Thanks,

Arnold




reply via email to

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