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

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

Problem with compl() in gawk-3.1.3


From: Mike Romaniw
Subject: Problem with compl() in gawk-3.1.3
Date: Sat, 27 Sep 2003 23:58:51 -0400 (EDT)

Hi,

        I just ran across a problem in gawk-3.1.3 which doesn't appear
in 3.1.2 or below with the compl() bit manipulation function.

        It looks like there's a loss of precision of the low 11 bits when
3.1.3 went from a (unsigned long) cast to (uintmax_t) in do_compl() in
builtin.c.   The behavior is the same under Sparc/Solaris, Intel FreeBSD,
and Intel Linux.

Given this code snippet:

BEGIN{ printf("%x\n",compl(0xf0f)) }

GNU Awk 3.1.0 properly returns:

fffff0f0


GNU Awk 3.1.3  returns:

fffffffffffff000
(should be)
fffffffffffff0f0

gawk was compiled on the above platforms using the stock gawk-3.1.3
distribution.  No options were given to the configure script.


Thanks for a great utility !!




reply via email to

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