Post Reply 
(42S) Function Table
02-22-2019, 07:18 AM
Post: #5
RE: (42S) Function Table
(02-22-2019 01:21 AM)ijabbott Wrote:  But if there are multiple places in FX where an error could occur, FX would need FC? 25, RET after each place where an error could occur.

I'd rather delegate the error-handling to the function FX instead.
It could return specific strings like "Error", "+Infty", "-Infty" or "÷ by 0" in case of errors.
Code:
00 { 21-Byte Prgm }
01▸LBL "FX"
02 X=0?
03 GTO 00
04 1/X
05 RTN
06▸LBL 00
07 "÷ by 0"
08 ASTO ST X
09 END

The program FTAB just creates the table.

Example:

-1 ENTER
0.25 ENTER
9
XEQ "FTAB"

x: [ 9×2 Matrix ]

-1.0000 -1.0000
-0.7500 -1.3333
-0.5000 -2.0000
-0.2500 -4.0000
0.0000 "÷ by 0"
0.2500 4.0000
0.5000 2.0000
0.7500 1.3333
1.0000 1.0000

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


Messages In This Thread
(42S) Function Table - Eddie W. Shore - 02-18-2019, 05:04 AM
RE: (42S) Function Table - ijabbott - 02-21-2019, 08:41 AM
RE: (42S) Function Table - Thomas Klemm - 02-21-2019, 11:57 AM
RE: (42S) Function Table - ijabbott - 02-22-2019, 01:21 AM
RE: (42S) Function Table - Thomas Klemm - 02-22-2019 07:18 AM
RE: (42S) Function Table - Eddie W. Shore - 02-22-2019, 02:02 PM
RE: (42S) Function Table - Thomas Klemm - 02-22-2019, 08:58 PM



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