Message342191
> 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. |
|
Date |
User |
Action |
Args |
2019-05-11 14:33:21 | mark.dickinson | set | recipients:
+ mark.dickinson, serhiy.storchaka |
2019-05-11 14:33:21 | mark.dickinson | set | messageid: <1557585201.27.0.831229876849.issue36887@roundup.psfhosted.org> |
2019-05-11 14:33:21 | mark.dickinson | link | issue36887 messages |
2019-05-11 14:33:21 | mark.dickinson | create | |
|