bug-bash
[Top][All Lists]
Advanced

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

Re: Bug fix for $((x**y)) algorithm on 64+ bits machines.


From: Stephane CHAZELAS
Subject: Re: Bug fix for $((x**y)) algorithm on 64+ bits machines.
Date: Wed, 28 Mar 2012 18:26:27 -0000
User-agent: slrn/pre1.0.0-18 (Linux)

2011-09-17, 13:06(+00), Stephane CHAZELAS:
> 2011-09-16, 17:17(-07), William Park:
>> 145557834293068928043467566190278008218249525830565939618481
>> is awfully big number! :-)
>
> 3**2**62 is 3**(2**62), 3**4611686018427387904, not a number you
> can represent with 64bits, nor any reasonable number of bits, 
> not (3**2)**62.
[...]

Sorry, my bad,

3**2**62 is indeed (3**2)**62 in bash and in zsh contrary to
most other places (ksh93, bc, python, gawk, perl, ruby...).

-- 
Stephane


reply via email to

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