TIP: Click on subject to list as thread! ANSI
echo: cis.os9.68000.osk
to: all
from: David A. Ferguson 73737,2471
date: 1995-08-15 23:13:17
subject: #NeedHelpToTrapError107!?

#: 21128 S12/OS9/68000 (OSK)
    15-Aug-95  23:13:17
Sb: #NeedHelpToTrapError107!?
Fm: David A. Ferguson 73737,2471
To: all

Help!,

I need to know how to trap a floating point error.  Currently my program is
aborted when the result of a floating point operation 'under flows' to zero.
The following program will generate the error on my system (which is an
Allen-Bradley 1771-DMC):

      void main ()
           {
           float g;

           for (g = 1.0; ; g /= 3.1415)
                printf("g=%g\n", g);
           }

Following are the last few lines that are printed before the program is dumped.

      g=1.62876e-37
      g=5.18466e-38
      g=1.65038e-38
      Error #000:107
      $

Error 107 is documented to be:

      E_TRAPV  /* TrapV instruction TRAP 7 occurred */

Any help would be greatly appreciated.

Thanks...David

There is 1 Reply.

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™.