[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gawk bug in exponentiation
From: |
Aharon Robbins |
Subject: |
Re: gawk bug in exponentiation |
Date: |
Wed, 15 Jun 2005 22:45:10 +0300 |
Greetings. Re this:
In article <address@hidden> you write:
>-=-=-=-=-=-
>
>On Tue, Jun 14, 2005 at 08:43:46AM -0400, Andrew J. Schorr wrote:
>> But beyond that, I think there are 2 issues here: 1. the same function should
>> be used in both places; and 2. the exponentiation algorithm is not very good,
>> instead exponentiation by squaring should be used:
>>
>> http://en.wikipedia.org/wiki/Exponentiation_by_squaring
>
>Give the attached patch a try. It uses exponentiation by squaring for
>all integral exponents. And it does so without recursion.
>
>Regards,
>Andy
I've applied the patch, after some minor edits. In the future, please
also supply a ChangeLog entry with your patches; that makes my life
easier.
Thanks!
Thanks also to John for pointing out the bug in the first place.
Arnold
--
Aharon (Arnold) Robbins --- Pioneer Consulting Ltd. arnold AT skeeve DOT com
P.O. Box 354 Home Phone: +972 8 979-0381 Fax: +1 206 350 8765
Nof Ayalon Cell Phone: +972 50 729-7545
D.N. Shimshon 99785 ISRAEL
- gawk bug, John H. DuBois III, 2005/06/14