[Python-ideas] Python3.3 Decimal Library Released

Antoine Pitrou solipsis at pitrou.net
Wed Mar 5 00:08:12 CET 2014


On Wed, 05 Mar 2014 11:17:17 +1300
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Andrew Barnert wrote:
> > On Mar 4, 2014, at 1:18, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> >
> >> If you've constructed it that way, you probably already know its square
> >> root.
> > 
> > Usually, but not always.
> 
> In any case, the fact remains that any algorithm for
> calculating the square root of a perfect square will
> work just as well in any base. There's nothing special
> about decimal in that regard.

The point was not decimal vs. binary, but arbitrarily high precision
vs. fixed low precision.
(i.e. if you have a 1000-digit integer, just calling N ** 0.5 will give
you a very low-precision result compared to the integer's precision).

Regards

Antoine.




More information about the Python-ideas mailing list