Continued fraction/Arithmetic/Construct from rational number: Difference between revisions
Continued fraction/Arithmetic/Construct from rational number (view source)
Revision as of 16:58, 20 April 2017
, 7 years ago→{{header|Sidef}}: updated code
m (→{{header|REXX}}: changed some comments, added/changed whitespace, ordered subroutines alphabetically, aligned statements.) |
m (→{{header|Sidef}}: updated code) |
||
Line 1,084:
<lang ruby>func r2cf(num, den) {
func() {
den
var q =
(num, den) = (den, num - q*den)
return q
Line 1,104:
[314285714/100000000],
].each { |seq|
seq.each { |r| showcf(r2cf(r.
print "\n"
}</lang>
|