Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: "Michael C. Grant" <mcgrant@mindspring.com>
Subject: Re: Division by zero crashes on DEC should be avoidable!
Date: 1998/03/06	[thread overview]
Message-ID: <6dpumh$27e@camel21.mindspring.com> (raw)
In-Reply-To: xzpd8g03t8k.fsf@grjottunagard.ifi.uio.no

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]


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 <andrewe@ned.dem.csiro.au> 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?






  parent reply	other threads:[~1998-03-06  5:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-06  5:00 Division by zero crashes on DEC should be avoidable! Andrew Ellerton
1998-03-06  5:00 ` mathog
1998-03-06  5:00   ` Michael C. Grant
1998-03-06  5:00     ` Pierre Asselin
1998-03-08  5:00       ` Michael C. Grant
1998-03-06  5:00 ` Dag-Erling Coidan Sm�rgrav
1998-03-06  5:00   ` John Wilson
1998-03-06  5:00   ` Michael C. Grant [this message]
1998-03-06  5:00     ` Jeffrey J. Potoff
1998-03-09  5:00     ` Dan A. Mercer
1998-03-06  5:00 ` Ron Natalie
1998-03-06  5:00 ` Daniel S. Riley
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox