Mark Dickinson <dicki...@gmail.com> added the comment:

> I am wondering whether int(sqrt(float(n))) can be used as a good initial 
> approximation.

It can, but I'd prefer to avoid floating-point arithmetic (we don't have any 
guarantees about the accuracy of sqrt, so you'd always need a check and a 
fallback for the case where sqrt isn't accurate enough), and there are other 
purely-integer-based ways to produce a fast initial approximation. I do have 
some plans to add optimizations, but wanted to get the basic algorithm in first.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36887>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to