Jump to content

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 3three levels, sowhich means that the recursive approach can be skippeddispensed with.
{| 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
1,150

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.