# my first programming experience on the hp50g - Hewlett Packard

This is a discussion on my first programming experience on the hp50g - Hewlett Packard ; alright so i've got through writing and running some simple programs on the hp50g. i've only tried stuff in "reverse polish notation" mode (rpn) so if programs are different in "algebraic" mode i'd be curious to know the pros and ...

# Thread: my first programming experience on the hp50g

1. ## my first programming experience on the hp50g

alright so i've got through writing and running some simple programs
on the hp50g.
i've only tried stuff in "reverse polish notation" mode (rpn) so if
programs are different in "algebraic" mode i'd be curious to know the
pros and cons of each.

how rpn seems to behave
************************************************** ******************************
as i understand it, rpn mode is for pushing numbers on a stack and
then performing operations and programs to the stuff on the stack.

so if i type [2] [enter] [2] [enter]
then i get a two line stack with the value 2 in each line of the stack

[+] seems like an operator that pops the last two lines off the stack,
adds them together and then pushes the result back to the stack
resulting in the ans=4

my understanding of writing a program on the hp50g
************************************************** ******************************
this is my very basic understanding of programming the hp50g so please
correct me or give me tips when needed.

programs on the hp50g are grouped operations inside of << and >>
symbols ([right-shift] [+] key) and each statement in the program is
separated with a space ([SPC] key) or newline ([right-shift] [.] key)

some simple programs that all evaluate to 4 are
<< 4 >>
<< 2 2 + >>
<< << 1 1 + >> EVAL << 1 1 + >> EVAL + >>

to actually "run" the program on the last line of the stack just press
the [EVAL] key

something i didn't understand yet is if i evaluate this program on
line 1 of the stack << 2 2 + >> then then number 4 replaces it. now
if i hit [left-shift] [enter] (or [ANS]) i get a three line stack that
looks like:

4
2
2

4
4

2. ## Re: my first programming experience on the hp50g

"ctrpapa" wrote in message
X
> some simple programs that all evaluate to 4 are
> << 4 >>
> << 2 2 + >>
> << << 1 1 + >> EVAL << 1 1 + >> EVAL + >>
>
> to actually "run" the program on the last line of the stack just press
> the [EVAL] key
>
>
> something i didn't understand yet is if i evaluate this program on
> line 1 of the stack << 2 2 + >> then then number 4 replaces it. now
> if i hit [left-shift] [enter] (or [ANS]) i get a three line stack that
> looks like:
>
> 4
> 2
> 2
>