On 9/19/11 2:35 PM, Stephane CHAZELAS wrote:
> FYI, ksh93 uses pow(3). So does zsh, but only in floating point
> mode.
>
> Probably better and more efficient than reinventing the wheel.
Maybe, but since bash doesn't use floating point arithmetic, probably
not.
--
``The lyf so short, the craft
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 implementa
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
>>
2011-09-19, 09:27(-04), Chet Ramey:
> On 9/16/11 4:39 PM, Nicolas ARGYROU wrote:
>
>> Bash Version: 4.0
>> Patch Level: 33
>> Release Status: release
>>
>> Description:
>> The algorithm used to calculate x to the power of y: x**y
>> takes O(y) time which is way too long on systems using 64
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 numbe
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.
Certainly not a number
Hello,
I noticed other shells have the same bug, and perhaps you would like to use
this code in other GNU projects (like making a library call or an executable).
The best, I think, is to transfer the copyright to bash maintainers. You can
now copyright
and license it the way you want:
templa
On 9/16/11 4:39 PM, Nicolas ARGYROU wrote:
> Bash Version: 4.0
> Patch Level: 33
> Release Status: release
>
> Description:
> The algorithm used to calculate x to the power of y: x**y
> takes O(y) time which is way too long on systems using 64 bits.
> Calculating for exemple $((3**2**
From: Nicolas ARGYROU
> >
> > You're right. Then, just do what you want with this piece of code, I make
> > it
> > public domain: no restriction at all on using it. It's a gift to bash as I
> > use it a lot. I also accept that you put my name and/or email with the
> > piece of
> > code in ca
I'm ok with using Bash's licence.
- Original Message -
From: William Park
To: Nicolas ARGYROU
Cc: bashbug
Sent: Monday, September 19, 2011 3:33 AM
Subject: Re: Bug fix for $((x**y)) algorithm on 64+ bits machines.
No. For example, current Bash is copyrighted and licen
g
> Sent: Saturday, September 17, 2011 11:35:08 PM
> Subject: Re: Bug fix for $((x**y)) algorithm on 64+ bits machines.
>
> You're right. Then, just do what you want with this piece of code, I make it
> public domain: no restriction at all on using it. It's a gift to bash a
)
Regards,
Nicolas Argyrou
- Original Message -
From: Dave Rutherford
To: Nicolas ARGYROU
Cc:
Sent: Saturday, September 17, 2011 10:34 PM
Subject: Re: Bug fix for $((x**y)) algorithm on 64+ bits machines.
On Sat, Sep 17, 2011 at 07:10, Nicolas ARGYROU wrote:
> I came up with a
.org"
Sent: Saturday, September 17, 2011 2:17 AM
Subject: Re: Bug fix for $((x**y)) algorithm on 64+ bits machines.
145557834293068928043467566190278008218249525830565939618481
is awfully big number! :-)
--
William
- Original Message -
> From: Nicolas ARGYROU
> To: "bug
145557834293068928043467566190278008218249525830565939618481
is awfully big number! :-)
--
William
- Original Message -
> From: Nicolas ARGYROU
> To: "bug-bash@gnu.org"
> Cc:
> Sent: Friday, September 16, 2011 4:39:41 PM
> Subject: Bug fix for $((x**y)) algorithm on 64+ bits machines
14 matches
Mail list logo