refactor: compose division ops for ContinuedFraction
#66
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
refactor
Refactoring changes
All division operations in
ContinuedFraction
:continuedfraction.ContinuedFraction.__truediv__
continuedfraction.ContinuedFraction.__rtruediv__
continuedfraction.ContinuedFraction.__floordiv__
continuedfraction.ContinuedFraction.__rfloordiv__
can be refactored by composing the division-free algorithms for the negation and inversion of simple continued fractions of positive rational numbers, which are described in the documentation.
A new with simple continued fraction : the positive inversion is given by:
__invert__
operation is required for the composition, which implements the following algorithm for the inversion of a positive rational numberand the negative inversion is given by:
In applying this algorithm there is an assumption that the last element , as any simple continued fraction of type can be reduced to the simple continued fraction .
The text was updated successfully, but these errors were encountered: