HP (Hewlett-Packard) HP 33s Calculator User Manual


 
13–12 Programming Techniques
File name 33s-English-Manual-040130-Publication(Edition 2).doc Page : 388
Printed Date : 2004/1/30 Size : 13.7 x 21.2 cm
Example: Using Flags.
The "Curve Fitting" program in chapter 16 uses flags 0 and 1 to determine
whether to take the natural logarithm of the X– and Y–inputs:
Lines S0003 and S0004 clear both of these flags so that lines W0007 and
W0011 (in the input loop routine) do not take the natural logarithms of the
X– and Y–inputs for a Straight–line model curve.
Line L0003 sets flag 0 so that line W0007 takes the natural log of the
X–input for a Logarithmic–model curve.
Line E0004 sets flag 1 so that line W0011 takes the natural log of the
Y–input for an Exponential–model curve.
Lines P0003 and P0004 set both flags so that lines W0007 and W0011
take the natural logarithms of both the X– and Y–inputs for a Power–model
curve.
Note that lines S0003, S0004, L0004, and E0003 clear flags 0 and 1 to ensure
that they will be set only as required for the four curve models.