[Nickle] Bug in exponentiation

Keith Packard nickle@nickle.org
Fri, 07 Feb 2003 13:01:20 -0800


Around 21 o'clock on Jan 24, "Ireland Peddlar" wrote:

> In writing a testing suite for nickle, I noticed that when dealing with a 
> perfect square nickle doesn't find a perfect answer.  For example, when 
> asked to evaluate 4**.5 nickle returns 1.99999999.

That's because ** calls the pow function and that function evaluated 
all non-integer exponents the same way (exp (log(a) * b)).  I've changed 
that function to recognise powers of 1/2 and 1/3 and call sqrt and cbrt.

> In nickle, **= does not work although the manual says it does.

There was a bug in the compiler that compiled the operands in the wrong 
order.

Thanks for your bug reports!

-keith