TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: Dan Charrois 70721,1506 (X)
from: James Jones 76257,562
date: 1990-05-29 20:46:30
subject: #3938-C error trapping

#: 3958 S3/Languages
    29-May-90  20:46:30
Sb: #3938-C error trapping
Fm: James Jones 76257,562
To: Dan Charrois 70721,1506 (X)

OK--there are errors and there are errors.  For instance--if you're on a 68020
and using a 68881, an attempt to divide by zero will blow you off with an
exception from the coprocessor.  Other errors are caught by defensive coding in
library routines and result in setting errno and returning some special value
(e.g. EOF from getc()).  Software floating-point behavior depends on how the
stuff is written, of course.

For division by zero, I fear that the best way to catch the problem is to test
the divisor before you divide.  (Alas, that won't catch overflow.) Different
routines handle errors differently, is about all I can say--read the docs
carefully.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.