The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

User RPL Question
Message #1 Posted by Paul Berger (Canada) on 21 Oct 2011, 9:41 a.m.

While playing with user RPL I have noticed that on 49G and later calculators my program that contains some nested loops performs much better if I put a decimal point after constants. On the 49G more than 4 times improvement in run time. I searched through the AUR but did not find any mention of what this does. Could someone point me to some information on what the decimal point does?

      
Re: User RPL Question
Message #2 Posted by Cristian Arezzini on 21 Oct 2011, 9:47 a.m.,
in response to message #1 by Paul Berger (Canada)

The HP49 and 50g have two different kinds of numbers: integers and reals. For example, "5." is a real and "5" is an integer. There are different internal algorithms depending on which one you use, and the difference in execution time can be really large, as you noticed! I had to modify all my old 48G programs, to add the "." after numbers...

Cristian

            
Re: User RPL Question
Message #3 Posted by Crawl on 21 Oct 2011, 10:05 a.m.,
in response to message #2 by Cristian Arezzini

Actually, if you open (for modifying) a program in approximate mode and save it, decimals will AUTOMATICALLY be added after every number.

Personally, I don't like that feature, as there is no (as far as I know) similar feature to remove all the decimals, and there have been times I accidentally added them and then needed to remove them manually.

                  
Re: User RPL Question
Message #4 Posted by Eddie W. Shore on 21 Oct 2011, 3:23 p.m.,
in response to message #3 by Crawl

Quote:
Actually, if you open (for modifying) a program in approximate mode and save it, decimals will AUTOMATICALLY be added after every number.

Personally, I don't like that feature, as there is no (as far as I know) similar feature to remove all the decimals, and there have been times I accidentally added them and then needed to remove them manually.


I ran into that situation myself - once the program adds automatic decimal points, there is no way back.

            
Re: User RPL Question
Message #5 Posted by Eddie W. Shore on 21 Oct 2011, 3:26 p.m.,
in response to message #2 by Cristian Arezzini

Quote:
The HP49 and 50g have two different kinds of numbers: integers and reals. For example, "5." is a real and "5" is an integer. There are different internal algorithms depending on which one you use, and the difference in execution time can be really large, as you noticed! I had to modify all my old 48G programs, to add the "." after numbers...

Cristian


Would you recommend that programs be entered and ran in Approx mode and if exact numbers/expressions are necessary just take a XQ or -> Q command at the end?

I just noticed that running ->Q switches the calculator from Approximate mode to Exact mode

Edited: 21 Oct 2011, 3:27 p.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall