From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e806d6e792a5af1f X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-09-02 02:05:13 PST Path: bga.com!news.sprintlink.net!hookup!yeshua.marcam.com!charnel.ecst.csuchico.edu!olivea!decwrl!pa.dec.com!nestvx.enet.dec.com!neideck From: neideck@nestvx.enet.dec.com (Burkhard Neidecker-Lutz) Newsgroups: comp.unix.osf.osf1 Subject: Re: IEEE Floating Point problem Date: 2 Sep 1994 07:50:34 GMT Organization: CEC Karlsruhe Message-ID: <346lgaINNbq2@usenet.pa.dec.com> References: <3450c9$hvg@crcnis1.unl.edu> NNTP-Posting-Host: BIER Keywords: Exception 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 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