Calkin-Wilf sequence: Difference between revisions

m
→‎{{header|REXX}}: added code to show the number of decimal digits in the last number displayed.
m (→‎{{header|REXX}}: added an argument when calling a function.)
m (→‎{{header|REXX}}: added code to show the number of decimal digits in the last number displayed.)
Line 999:
n= rle2dec( frac2cf(p q) ); @CWS= 'the Calkin─Wilf sequence'
say 'for ' p"/"q', the element number for' @CWS "is: " commas(n)th(n)
if length(n)<10 then return
say; say 'The above number has ' commas(length(n)) " decimal digits."
return
/*──────────────────────────────────────────────────────────────────────────────────────*/