Continued fraction/Arithmetic/Construct from rational number: Difference between revisions
Content added Content deleted
m (→version 3) |
m (J →version 2: indentation) |
||
Line 493: | Line 493: | ||
==== version 2 ==== |
==== version 2 ==== |
||
<lang J> |
<lang J> |
||
f =: 3 : 0 |
|||
a =. {.y |
a =. {.y |
||
b =. {:y |
b =. {:y |
||
out=. <. a%b |
out=. <. a%b |
||
while. b > 1 do. |
while. b > 1 do. |
||
'a b' =. b; b|a |
'a b' =. b; b|a |
||
out=. out , <. a%b |
out=. out , <. a%b |
||
end. |
end. |
||
) |
) |
||
f each 1 2;3 1;23 8;13 11;22 7;14142136 10000000;_151 77 |
f each 1 2;3 1;23 8;13 11;22 7;14142136 10000000;_151 77 |