Post Reply 
2023 RPN HHC Programming Contest
10-26-2023, 11:41 PM (This post was last modified: 10-27-2023 06:14 PM by Gerson W. Barbosa.)
Post: #69
RE: 2023 RPN HHC Programming Contest
(10-26-2023 09:11 PM)Gerson W. Barbosa Wrote:  
(10-26-2023 08:47 PM)Paul Dale Wrote:  Gerson's challenge to get 7141 can be done in 7 steps:

PI LN ->H LOG ACOS x^2 INT


Indeed! I would need pi/2 times more steps.

HP-41C:

Code:

 01 LBL "ABC"
 02 SIGN
 03 ST+ X
 04 1/X
 05 ACOS
 06 X^2
 07 PI
 08 INT
 09 X^2
 10 X^2
 11 +
 12 OCT
 13 END

HP-42S:

Code:

00 { 18-Byte Prgm }
01▸LBL "ABC"
02 PI
03 IP
04 X↑2
05 LASTX
06 SQRT
07 ATAN
08 COMPLEX
09 ABS
10 X↑2
11 →OCT
12 END

For some reason on Free42 (3.0.21) it stops at step 11 with an error message (Invalid Data).

P.S.: On Free42 the result at step 10 is 3680.999999999999999999999999999995 instead of 3681. →OCT requires an integer argument. That’s an example of a program that works on the HP-42S but not on Free42 because the internal results are not rounded to the number of digits of the display like on the latter.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
2023 RPN HHC Programming Contest - Gene - 10-07-2023, 01:00 PM
RE: 2023 RPN HHC Programming Contest - Gerson W. Barbosa - 10-26-2023 11:41 PM



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