[Python-ideas] Python3.3 Decimal Library Released

David Mertz mertz at gnosis.cx
Tue Mar 4 00:07:57 CET 2014


On Mon, Mar 3, 2014 at 3:01 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> For the record, int doesn't have a sqrt() method while Decimal has, so
> if you wanna take the exact square root of a large integer, you'd better
> convert it to a Decimal.
>

Well, actually, if you want to take the square root of a large integer,
most times you'll need an irrational number as a value.  Unfortunately,
neither floats, decimals, nor fractions are able to do that (nor any finite
representation that is numeric; you can only use symbolic ones).

On the other hand, now that you mention it, a floor_sqrt() function that
operated quickly on ints would be nice to have.  But that's a different
thread.


-- 
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140303/3851bee6/attachment-0001.html>


More information about the Python-ideas mailing list