Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Ron Natalie <ron@sensor.com>
Subject: Re: Division by zero crashes on DEC should be avoidable!
Date: 1998/03/06	[thread overview]
Message-ID: <35001A45.60E8B7EB@sensor.com> (raw)
In-Reply-To: 34FF7719.41C6@ned.dem.csiro.au


Andrew Ellerton wrote:
>        On other UNIX platforms the application I have to port
>         to DEC works fine - including handling division by zero
>         with only a warning, presumably using not-a-number (NaN)
>         or INF symbols as the result. Sure, I know it should
>         never try to divide by zero, but it does.

On SOME other UNIX platforms.  Actually, machines that do not
FPE on divide by zero's are the exception in my experience,
you're doing an invalid operation, don't you want to know about
it?

You'll also find the DEC unique in that it will FPE even on
doubles from memory that have invalid format (most machines
don't FPE until you do an opreation with them).  Make sure
things are INITIALIZED.

>         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?

There might be a compiler option, I don't know.
You could also try catching/ignoring SIGFPE, but that's
frought with peril.



      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 ` Dag-Erling Coidan Sm�rgrav
1998-03-06  5:00   ` Michael C. Grant
1998-03-06  5:00     ` Jeffrey J. Potoff
1998-03-09  5:00     ` Dan A. Mercer
1998-03-06  5:00   ` John Wilson
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 ` Daniel S. Riley
1998-03-06  5:00 ` Ron Natalie [this message]
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