Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: neideck@nestvx.enet.dec.com (Burkhard Neidecker-Lutz)
Subject: Re: IEEE Floating Point problem
Date: 2 Sep 1994 07:50:34 GMT	[thread overview]
Message-ID: <346lgaINNbq2@usenet.pa.dec.com> (raw)
In-Reply-To: 3450c9$hvg@crcnis1.unl.edu

In article <3450c9$hvg@crcnis1.unl.edu> dwilliss@csealumni.unl.edu (David Williss) writes:
>I have a problem with floating point on our OSF/1 machine (It's a DEC 
>Alpha).  IEEE specifies that the result of dividing anything by 0
>should be INF or -INF (depending on the numerator), with the exception
>that 0/0 and INF/INF are both NaN (Not A Number).
>
>On our alpha/OSF/1, These procuded FP Exceptions and exited with a
>core dump.  I found the man page ieee(3), and it gave some suggestions,
>none of which did what I wanted.

	% cat a.c
	#include <stdio.h>

	main(argc,argv)
	int argc;
	char *argv[];
	{
	  double i,j;

	  i = 5;
	  j = 0;
	  printf("%f\n",i/j);
	}
	% cc a.c
	% ./a.out
	Floating exception
	% cc -ieee_with_no_inexact a.c
	% ./a.out 
	INF

If you want IEEE semantics, you have to tell the compiler with the
-ieee_xxx flags. This *is* in the cc(1) man page.

		Burkhard Neidecker-Lutz

GLASS Project, CEC Karlsruhe 
Advanced Technology Group, Digital Equipment Corporation
neideck@nestvx.enet.dec.com



      reply	other threads:[~1994-09-02  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-09-01 16:43 IEEE Floating Point problem David Williss
1994-09-02  7:50 ` Burkhard Neidecker-Lutz [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