Relational and logical operators, Relational operators – HP 48gII User Manual

Page 692

Advertising
background image

Page 21-43


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.]: “ {“ :V: :T: :n: “ {2 0} V }

INPUT OBJ→ → V T n

«

V DTAG T DTAG n DTAG → V T n

«

“V=” V →STR + “ ”+ “T=” T →STR + “ ” + “n=” n →STR +

“ ” +
‘8.31451*n*T/V‘ EVAL →STR “p=” SWAP + + + + MSGBOX » » »

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
operators are used to make a statement regarding the relative position of two
or more real numbers. Depending on the actual numbers used, such a

Advertising
This manual is related to the following products: