bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gawk bug in exponentiation


From: Andrew J. Schorr
Subject: Re: gawk bug in exponentiation
Date: Tue, 14 Jun 2005 09:43:00 -0400
User-agent: Mutt/1.4.1i

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

Attachment: exp.patch
Description: Text document


reply via email to

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