Continued fraction/Arithmetic/Construct from rational number: Difference between revisions

m
J →‎version 2: indentation
m (J →‎version 2: indentation)
Line 493:
==== version 2 ====
<lang J>
f =: 3 : 0
a =. {.y
b =. {:y
out=. <. a%b
while. b > 1 do.
'a b' =. b; b|a
out=. out , <. a%b
end.
)
f each 1 2;3 1;23 8;13 11;22 7;14142136 10000000;_151 77
6,962

edits