Relational And Logical Operators; Relational Operators - HP 50g User Manual

Graphing calculator
Hide thumbs Also See for 50g:
Table of Contents

Advertisement

Press @@@OK@@@ to cancel message box output.
Message box output without units
Let's modify the program @@@p@@@ once more to eliminate the use of units
throughout it. The unit-less program will look like this:
"Enter V,T,n [S.I.]: " {"
«
INPUT OBJ
«
V DTAG
T DTAG
"V=" V
STR + "
«
"
" +
'8.31451*n*T/V' EVAL
And when run with the input data V = 0.01, T = 300, and n = 0.8, produces
the message box output:
Press @@@OK@@@ to cancel the message box output.

Relational and logical operators

So far we have worked mainly with sequential programs. The User RPL
language provides statements that allow branching and looping of the program
flow. Many of these make decisions based on whether a logical statement is
true or not. In this section we present some of the elements used to construct
such logical statements, namely, relational and logical operators.

Relational operators

Relational operators are those operators used to compare the relative position
of two objects. For example, dealing with real numbers only, relational
V T n
n DTAG
"+ "T=" T
STR "p=" SWAP + + + + MSGBOX » » »
:V:
:T:
V T n
STR + "
:n: " {2 0} V }
" + "n="
n
STR +
Page 21-43

Advertisement

Table of Contents
loading

Table of Contents