This is a small piece of User-RPL code that computes the last nonzero digit of the factorial of a natural number. Note that this code was developed independently and without knowledge of Scott Hemphill's solution which was posted to comp.sys.hp48 on September, 26, 2000 in the "MC: Factorials, zeros and such..." thread.

This code has been sitting in my HP48GX calculator's memory for over seventeen years, as I wrote it around the same time I started the comp.sys.hp48 thread "MC: Factorials, zeros and such..."

The code follows below -- It is 127.5 bytes with a CRC of # 8AE7h (On an HP48-G/GX-R -- the CRC will be different on other calculators) :

The files included in this archive are listed below :

FACTDIGITHP48-R binary of code
FACTDIGIT.ASCHP48 ASCII translation of code (should be compatible with the HP48S/SX, HP49 and HP50 as well)
factdigit.txtASCII version of this file
factdigit.htmlThis file

Jonathan Busby