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

m
J: simplify tacit version
(Add Perl)
m (J: simplify tacit version)
Line 433:
===Tacit version===
This version is a modification of an explicit version shown in http://www.jsoftware.com/jwiki/Essays/Continued%20Fractions to comply with the task specifications.
<lang j>cf=.: _1 }:@:({:"1 ,@:(}. (, <.)@%@-/@] ::]^:(<_) a:@(, <.)) @(%&x:&>/)</lang>
==== Examples ====
<lang j> cf each 1 2;3 1;23 8;13 11;22 7;14142136 10000000;_151 77
Line 453:
<lang j> _2 25 1 2 =&((+ %)/) _1 _1 _24 _1 _2
1</lang>
 
===Explicit versions===
==== version 1 ====
6,962

edits