New function: continued_fraction_convergents
continued_fraction_iterator: fix it for negative numbers
continued_fraction_periodic: return a rational if d is a perfect square
New function: continued_fraction_reduce
Fix formatting, add summary lines to docstrings
Merge pull request #7571 from skirpichev/cont_frac

Rebase of #7538