Factorial: Difference between revisions
m
Solve bug for 0!
(add TI-57) |
m (Solve bug for 0!) |
||
Line 9,830:
=={{header|TI-57}}==
The program stack has only
{| class="wikitable"
! Machine code
Line 9,837:
|
Lbl 0
C.t
x=t
1
STO 0
Lbl 1
Line 9,849 ⟶ 9,852:
|
program factorial(x) // x is the display register
if x=0 then
x=1
r0 = x
loop
|