The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

48GX - Silly question?
Message #1 Posted by mr-scorpio on 18 July 2011, 12:13 p.m.

Hi there, Still finding my way around the 48GX. Maybe a silly question. I remember seeing on both the TI-92+ & TI-89, that if you keyed in the factorial 100! - it calculated & displayed the whole 157 digit factorial, that you could literally scroll though. It could even calculate higher values..

Putting aside the reason for a 'need' for this... Can, or is there a way that the HP 48GX can ALSO display either the details of an exponent of large calculation OR the results to such a high degree of digits, like 100!

48GX 100! = 9.33262154439E157 TI-89 100! = All 157 digits

IF TI deemed this ability useful ... What is HP's response in like for like capability?

Many thanks Al

      
Re: 48GX - Silly question?
Message #2 Posted by Vladan Dugaric on 18 July 2011, 12:49 p.m.,
in response to message #1 by mr-scorpio

HP-50G gives all digits too. You just have to use Exact mode and type the number without a decimal point.

      
Re: 48GX - Silly question?
Message #3 Posted by bill platt on 18 July 2011, 12:50 p.m.,
in response to message #1 by mr-scorpio

You need ALG48 or Erable (I can't remember whether either will do it) or other software loaded onto the 48GX to do that. In the 49G and all later versions (49G+, 50G) HP incorporated that feature as "exact" mode.

      
Re: 48GX - Silly question?
Message #4 Posted by Mike Morrow on 18 July 2011, 12:55 p.m.,
in response to message #1 by mr-scorpio

Quote:
48GX 100! = 9.33262154439E157 TI-89 100! = All 157 digits

IF TI deemed this ability useful ... What is HP's response in like for like capability?


It's called the HP 49g+ and the HP 50g. (Integer calculations in EXACT vs. APPROXIMATE mode. The HP 48 series has no equivalent mode.)

            
Re: 48GX - Silly question?
Message #5 Posted by mr-scorpio on 18 July 2011, 1:07 p.m.,
in response to message #4 by Mike Morrow

Ah.. So it's a CAS feature. that explains things. Many thanks Al

      
Re: 48GX - Silly question?
Message #6 Posted by Alejandro Paz (Germany) on 18 July 2011, 3:31 p.m.,
in response to message #1 by mr-scorpio

The 48GX is from 93 and the TI-92 (the first one with such a feature) is from 95 :). That may explain why they cannot be actually compared. (I like some features from the 92 but I hardly use it).

Edited: 18 July 2011, 3:32 p.m.

      
Re: 48GX - Silly question?
Message #7 Posted by C.Ret on 19 July 2011, 5:49 a.m.,
in response to message #1 by mr-scorpio

Hi,

This is not a silly question, but an interessant computing challenge on both HP28 and HP48 advanced calculators.

Fortunately, and without any "Erable" add-in or any newer CAS feature, any HP-48 are able to compute and display any digits of the n! factorial by using a quite easy and not so elaborated dFACT program which was compose by myself in 1989 for the same purpose on a HP-28S.

For easy reading and printing dFACT returns all digits of the n! factorial into the stack by ten-digit numbers. Printing will be easy with print stack command PRST and storing all this stuff in a list by using DEPTH ->LIST sequence.

 « -> n                           @ input n from stack
   « n ->STR 33 CHR + 61 CHR +    @ put string "n!=" on top of stack
     2 ‘d’ STO                    @ initialize dimension d
     1                            @ initialize stack with 1!
     1 n FOR k                    @ main loop n!=1*2* ... *k*...*n
        0                         @ zero carry
        2 d FOR p                 @ for each of the d ten-digit-number
           p ROLL                 @ p-th ten-digit from stack
           k *                    @ multiply by k
           +                      @ add carry
           1E10 MOD               @ ten-digit rest
           LAST / IP              @ set and round carry
           SWAP p ROLLD           @ roll ten-digit back in stack
        NEXT
        IF DUP                    @ test last carry
        THEN                      @ if any 
           d ROLLD                @ add one more ten-digit in stack
           ‘d’ 1 STO+             @ increase d value 
        ELSE
           DROP                  @  erase null carry
        END
     NEXT
   »
»
‘dFACT’ STO

Examples:

0 dFACT                -->2:                "0!="
                          1:                    1

1 dFACT -->2: "1!=" 1: 1

5 dFACT -->2: "5!=" 1: 120

13 dFACT -->2: "13!=" 1: 6227020800

14 dFACT -->3: "14!=" 2: 8 1: 7178291200

17 dFACT -->3: "17!=" 2: 35568 1: 74280960000

Upto ther nothing special and results are equivalent to built-in FACT instruction.

23 dFACT               -->4:               "23!="
                          3:                  258
                          2:           5201673888
                          1:           4976640000

100 dFACT --->17: "100!=" 16: 93326215 15: 4439441526 14: 8169923885 13: 6266700490 12: 7159682643 11: 8162146859 10: 2963895217 9: 5999932299 8: 1560894146 7: 3976156518 6: 2862536979 5: 2082722375 4: 8251185210 3: 9168640000 2: 0 1: 0

Main inconvenient is exponential computation time, on HP28C/S : 10! Need only 2"00, 50! nearly 11"48, 100! is about 44"94, 150! as long as 1’45"05, . . . , 400! In nearly 16’30" and at least 446! in 21 very long minutes.

Source (in Fench only): http://www.silicium.org/forum/viewtopic.php?f=46&t=20757&start=45

            
Re: 48GX - Silly question?
Message #8 Posted by bill platt on 19 July 2011, 12:26 p.m.,
in response to message #7 by C.Ret

Very Cool!

            
Re: 48GX - Silly question?
Message #9 Posted by mr-scorpio on 20 July 2011, 5:14 a.m.,
in response to message #7 by C.Ret

Excellent little program! Thank you for the suggestion

            
Re: 48GX - Silly question?
Message #10 Posted by Gerson W. Barbosa on 20 July 2011, 8:19 a.m.,
in response to message #7 by C.Ret

Quote:
Main inconvenient is exponential computation time,

Anyway, your algorithm appears to be about three times faster than the one in the last message of this old thread, for the HP-41/HP-42S:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv016.cgi?read=108035

The author has used a LOG instruction somewhere in his program, which may have slowed it down a bit.

Thanks for sharing it.

Gerson.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall