Post Reply 
Example Program to calculate Factorial
02-03-2018, 08:56 AM (This post was last modified: 02-03-2018 09:21 AM by Dieter.)
Post: #35
RE: Example Program to calculate Factorial
(02-02-2018 09:58 PM)Gerson W. Barbosa Wrote:  Try adding EEX as your first step. If it works that’ll make 8 steps. Still pretty good!

PS: It will work only for x=0 and x=1. ...

On the HP25 it also works for other input. This seems to be related to a bug, err... "special feature" that has been discussed earlier: R/S obviously does not terminate number entry so that the EEX is appended to the entered number.

But this only works if you manually type your input. You can't recall it from a register, like [RCL] 2 [R/S]. ;-)

(02-02-2018 09:58 PM)Gerson W. Barbosa Wrote:  I have a dead 29C in front of me and can’t think of anything better than [ x=0 ] [ e^x ], which makes 9 steps.

What about this?

Code:
01  STO 0
02  1
03  x>y?
04  STO 0
05  LBL 0
06  RCL 0
06  x
07  DSZ
09  GTO 0

Same number of steps but a tiny bit faster as no transcendental function is required.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Example Program to calculate Factorial - Dieter - 02-03-2018 08:56 AM



User(s) browsing this thread: 3 Guest(s)