HP -32S Owner's Manual page 99

Rpn scientific calculator
Table of Contents

Advertisement

lines Q14 through Q19 calculate B2 - 4AC. The following lines test
for a negative value (which would produce an imaginary root).
Q20x<0?
Is result negative?
Q21GT0I
If yes, branches to different routine.
Q22SQRT
If positive, takes square root.
Flags
A flag is an indicator of status. It is either set (true) or clear (false).
Testing a flag is another conditional test that follows the 'Do if true*
rule: program execution proceeds directly if the tested flag is set, and
it skips one line if the flag is clear.
Meanings off Flags. The HP-32S has seven flags, numbered 0
through 6. All of these flags can be set, cleared, and tested by a pro
gram instruction. You can also set and clear flags from the keyboard.*
• Flags 0,1, 2, 3, and 4 have no preassigned meanings. Thatis, their
status will mean whatever you define it to mean in a given pro
gram. (See the example below.)
• Flag 5, when set, will interrupt a program when an overflow occurs
within the program, displaying OVERFLOW and A.* If flag 5 is
clear, a program with an overflow is not interrupted, though
OVERFLOW is displayedbriefly when the programeventually stops.
• Flag 6 is automatically set by the calculator any time an overflow
occurs (although you can also set flag 6 yourself). It has no effect,
but can be tested.
*The only other action that clears flags is thethree-key memory clearing operation described
in appendix B.
t An overflow occurs when a result exceeds thelargest number that the calculator can handle.
The largest possible number is substituted for the overflow result.
6: Programming Techniques
97

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents