Multifactorial: Difference between revisions

Line 1,970:
Recursivity is the simplest way to implement the task in RPL.
{{works with|Halcyon Calc|4.2.7}}
'''Recursive version'''
≪ DUP2 -
IF DUP 1 ≤ THEN DROP2 ELSE SWAP NFACT * END
'NFACT' STO
'''Iterative version'''
≪ OVER
WHILE DUP2 < REPEAT OVER - DUP 4 ROLL * ROT ROT END
DROP2
'NFACT' STO
 
≪ 1 5 FOR p
{ } 1 10 FOR n
1,150

edits