Continued fraction/Arithmetic/Construct from rational number: Difference between revisions
Content added Content deleted
Line 3,422: | Line 3,422: | ||
(if (Denominator = zero) |
(if (Denominator = zero) |
||
then (CF = lazy_list(delay((func) = nil))) |
then (CF = lazy_list(delay((func) = nil))) |
||
else (CF = lazy_list(delay( |
else (CF = lazy_list(delay(Cons)), |
||
Cons = ((func) = cons(Quotient, |
|||
r2cf(Denominator, Remainder))), |
|||
%% What follows is division with truncation towards zero. |
%% What follows is division with truncation towards zero. |
||
divide_with_rem(Numerator, Denominator, |
divide_with_rem(Numerator, Denominator, |