Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: "Jeffrey J. Potoff" <jpotoff@rhea.umd.edu>
Subject: Re: Division by zero crashes on DEC should be avoidable!
Date: 1998/03/06	[thread overview]
Message-ID: <35008C81.167E@rhea.umd.edu> (raw)
In-Reply-To: 6dpumh$27e@camel21.mindspring.com


Michael C. Grant wrote:
> 
> 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.
> 

Perhaps this is what you're looking for (try 'man cc') ?

 -ieee
      Ensure support of all portable features of the IEEE Standard for
Binary
      Floating-Point Arithmetic (ANSI/IEEE Std 754-1985), including the
      treatment of denormalized numbers, NaNs, and infinities and the
han-
      dling of error cases.  This flag also sets the _IEEE_FP C
preprocessor macro.

      If your program must use IEEE signaling features that are not
portable
      across different IEEE implementations, see the ieee(3) reference
page
      for a discussion of how to access them under the Digital UNIX
operating
      system.



  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   ` John Wilson
1998-03-06  5:00   ` Michael C. Grant
1998-03-06  5:00     ` Jeffrey J. Potoff [this message]
1998-03-09  5:00     ` Dan A. Mercer
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
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