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: Chet Ramey
Subject: Re: Bug fix for $((x**y)) algorithm on 64+ bits machines.
Date: Sun, 02 Oct 2011 21:07:57 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2

On 9/19/11 2:35 PM, Stephane CHAZELAS wrote:

>> Thanks for the report.  This looks like an independent reimplementation of
>> the "exponentiation by squaring" method.  I did a little looking around,
>> and it's the best algorithm out there.  I used a slightly different but
>> equivalent implementation.
> [...]
> 
> FYI, ksh93 uses pow(3). So does zsh, but only in floating point
> mode.

Bash doesn't use floating point.  It does all of its arithmetic in
intmax_t.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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