fix: enforce simple form uniqueness in ContinuedFraction.extend
op
#127
Labels
code quality
Code quality measures
ContinuedFraction.extend
op
#127
Enforce simple form uniqueness (of sequences of elements) in
ContinuedFraction``extend
operation - the current implementation allows the construction of instances with sequences of elements with the terminal element being1
, violating uniqueness. Not a bug as op constructs the correct fractions in extensions, but anomaly in the uniquness of sequence of elements needs fixing.For the tail extension
(3 4) ~> (3, 4, 1)
the resulting instanceContinuedFraction(16, 5)
is correct as a fraction but as a unique simple continued fraction should have the sequence of elements3, 5
rather than the sequence3, 4, 1
, as[3; 5] = [3; 4 + 1] = [3; 4, 1]
. Same for the tail extension(3, 4) ~> (3, 4, 2, 1)
: the resulting instanceContinuedFraction(42, 13)
is correct as a fraction but as a unique simple continued fraction should have the sequence of elements3, 4, 3
rather than the sequence3, 4, 2, 1
, as[3; 4, 3] = [3; 4, 2 + 1] = [3; 4, 2, 1]
.The text was updated successfully, but these errors were encountered: