EasyManuals Logo

HP 50G User Manual

HP 50G
887 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #713 background imageLoading...
Page #713 background image
Page 21-66
These are the components of the IFERR … THEN … END construct or of the
IFERR … THEN … ELSE … END construct. Both logical constructs are used for
trapping errors during program execution. Within the @)ERROR sub-menu,
entering @)IFERR, or @)IFERR, will place the IFERR structure components in
the stack, ready for the user to fill the missing terms, i.e.,
The general form of the two error-trapping constructs is as follows:
IF trap-clause THEN error-clause END
IF trap-clause THEN error-clause ELSE normal-clause END
The operation of these logical constructs is similar to that of the IF … THEN …
END and of the IF … THEN … ELSE … END constructs. If an error is detected
during the execution of the trap-clause, then the error-clause is executed.
Otherwise, the normal-clause is executed.
As an example, consider the following program (@ERR1) that takes as input two
matrices, A and b, and checks if there is an error in the trap clause: A b / (RPN
mode, i.e., A/b). If there is an error, then the program calls function LSQ (Least
SQuares, see Chapter 11) to solve the system of equations:
« A b « IFERR A b / THEN LSQ END » »
Try it with the arguments A = [ [ 2, 3, 5 ] , [1, 2, 1 ] ] and b = [ [ 5 ] , [ 6 ] ].
A simple division of these two arguments produces an error: /Error: Invalid
Dimension.
However, with the error-trapping construct of the program, @ERR1, with the same
arguments produces: [0.262295…, 0.442622…].

Table of Contents

Other manuals for HP 50G

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP 50G and is the answer not in the manual?

HP 50G Specifications

General IconGeneral
Digits33 digits
Battery typeCR2032
TypeScientific
Form factorPocket
Weight and Dimensions IconWeight and Dimensions
Weight220 g
Dimensions (WxDxH)87 x 184 x 23.5 mm

Related product manuals