|
From: | Roman Rakus |
Subject: | Re: Can arithmetic evaluation trap more than just division by zero? |
Date: | Tue, 06 Apr 2010 15:49:11 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc11 Lightning/1.0b2pre Thunderbird/3.0.4 |
On 04/06/2010 02:35 PM, Greg Wooledge wrote:
On Tue, Apr 06, 2010 at 02:21:05PM +0200, Roman Rakus wrote:$((2 ** 63 / -1))I can reproduce it in 4.1.2(1)-release and 4.0.23(1)-release on x86_64 GNU/Linux. I didn't try on bash 3.2.cyclops:~$ uname -a; echo $BASH_VERSION OpenBSD cyclops.wooledge.org 4.6 GENERIC.MP#81 amd64 4.0.24(1)-release cyclops:~$ echo $((2 ** 63 / -1)) Connection to cyclops closed. griffon:~$ An amd64-specific bug, then? (The Linux box I tested on earlier is i386, and the HP-UX box is PA-RISC 2.0.)
I guess the bug is somewhere in glibc and specific for 32 bit systems. (2^63) is same as (2^63/-1) on 32bit system (tested on ppc32). RR
[Prev in Thread] | Current Thread | [Next in Thread] |