-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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 __invert__ operation is required for the composition, which implements the following algorithm for the inversion of a positive rational number
This makes it possible to implement negative inversion
In applying this algorithm there is an assumption that the last element