Post Reply 
[35s] Program Err Trapping
04-24-2016, 03:09 PM
Post: #3
RE: [35s] Program Err Trapping
First of all, hello and welcome.

(04-24-2016 08:40 AM)brianddk Wrote:  I've noticed on other models (and simulators) there are flag configurations that would effectively amount to 'Continue On Error'. For the hp42s, this would refer to flag 25 (User's Guide pg 275).

The 41C was the first HP to include flags for error trapping (flag 25 for all errors, flag 24 for overflow). Earlier calculators – and most midrange programmable models that followed – did not offer such a feature.

(04-24-2016 08:40 AM)brianddk Wrote:  Since there doesn't appear to be a CPLX? or VECT? instruction

No, there are no such tests. But nevertheless your program can check whether X is a simple real, a vector or complex. I seem to remember this has been discussed here some time ago.

(04-24-2016 08:40 AM)brianddk Wrote:  This is the best I can come up with to trap for errors in my programs.
Anyone have a better way for the 35s?

IMHO the best method is a careful choice of the algorithm and a close look at the mathematics behind them. The points where errors may occur usually can be identified beforehand, e.g. in your example the sqrt where X may be negative. Here a x<0? test can branch to an alternate routine that may handle this case, e.g. evaluating the sqrt by 0,5 i 0  y^x in order to get a complex solution.

Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
[35s] Program Err Trapping - brianddk - 04-24-2016, 08:40 AM
RE: [35s] Program Err Trapping - brianddk - 04-24-2016, 02:44 PM
RE: [35s] Program Err Trapping - Dieter - 04-24-2016 03:09 PM
RE: [35s] Program Err Trapping - brianddk - 04-29-2016, 10:45 PM

User(s) browsing this thread: 1 Guest(s)