3-arg float pow()

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Sep 4 07:19:33 EDT 2001


Mon, 3 Sep 2001 16:51:19 -0400, Tim Peters <tim.one at home.com> pisze:

> This is *less* accurate than using a good-quality libm pow() (which
> should have worst-case final error strictly less than 1 ULP), so
> current CVS Python uses the libm pow() instead.  The last few bits
> may differ -- or as many as the last 15-or-so bits if the platform
> libm pow() truly sucks.

I would expect pow to use multiplication when the exponent is an
integer (with a signle division if it's negative), and the libm
pow or equivalently exp(b*ln(a)) if the exponent is a float.
All independently of the base.

So (-3)**2 would be defined, but (-3)**2.0 would be not.
And 3**(-2) should return a rational.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list