From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fc89c,7e35f49d4d9340ab X-Google-Attributes: gidfc89c,public X-Google-Thread: 109fba,7e35f49d4d9340ab X-Google-Attributes: gid109fba,public X-Google-Thread: 1164f8,7e35f49d4d9340ab X-Google-Attributes: gid1164f8,public From: "Michael C. Grant" Subject: Re: Division by zero crashes on DEC should be avoidable! Date: 1998/03/06 Message-ID: <6dpumh$27e@camel21.mindspring.com>#1/1 X-Deja-AN: 331541077 References: <34FF7719.41C6@ned.dem.csiro.au> X-Server-Date: 6 Mar 1998 22:52:01 GMT X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: MindSpring Enterprises Newsgroups: comp.sys.dec,comp.lang.c++,comp.unix.programmer Your attitude is somewhat unattractive here, especially since you're wrong. There is a compiler flag to disable floating-point exceptions of this type; catching signals is a slow and unnecessarily complex solution to the problem. In most scientific contexts, dividing by zero is not only legal but a very nice idiom. Working with infinity is not particularly difficult. In fact, IEEE floating-point standards allow it. What the poster does not know is that there is a compiler flag in DEC C++ that allows division by zero and other floating-point exceptions to go unreported. It is on by default because, admittedly, many people such as yourself and others _don't_ intend to divide by zero---so those of us that do should know enough to enable it. I _disagree_ with DEC's choice here, but so be it. Michael Dag-Erling Coidan Sm�rgrav wrote in message ... >Andrew Ellerton writes: >> However, the C++ code will crash the entire application >> on the DEC 4.0 version when it divides by zero. Is this >> solvable by (for example) compiling with a certain switch? >> Or is there any other way to stop it from crashing, or do >> I have to resort to modifying the code? > >Don't do that, then. > >Honestly, you're complaining that your program is crashing when you're >doing something illegal?