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: Mon, 19 Sep 2011 19:24:42 +0100
User-agent: slrn/pre1.0.0-18 (Linux)

2011-09-17, 13:39(+00), Stephane CHAZELAS:
> 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...).

Sorry again,

I was right in the first place,

3**2**62 is 3**(2**62) in bash and zsh like in other shells.

I think I need more sleep...

-- 
Stephane



reply via email to

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