Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!clyde!cuae2!ihnp4!chinet!megabyte From: megabyte@chinet.UUCP (Dr. Megabyte) Newsgroups: comp.unix.questions Subject: Division by Zero questions? Message-ID: <763@chinet.UUCP> Date: Thu, 13-Nov-86 16:16:26 EST Article-I.D.: chinet.763 Posted: Thu Nov 13 16:16:26 1986 Date-Received: Sun, 16-Nov-86 00:20:10 EST Reply-To: megabyte@chinet.UUCP (Dr. Megabyte) Distribution: net Organization: chi-net, Public Access UN*X, Chicago IL Lines: 35 Summary: Which version of Unix is "right" The following questions relate to the following short "C" program: main() { float x; float y; y = 0; x = 5/y; printf("%f \n",x); } On my AT&T 3b2/400 with SYS V R2.04, the program dumps core at the line with the division and prints the message:"Floating Point Exception - Core dumped". This seemed reasonable to me. The I tried the same program on my Zilog Model 31 running Zeus 3.21, which is a SYS III port and the program did NOT dump core. When it got to the printf statement it printed "INF" Which I assume must mean "Is Not Float". I can find no documentation on this, though if I change the floats above to ints, the Zilog prints "NAN" as the result. Now, I feel the AT&T is doing the correct thing. The question is what in the world is my Zilog doing, and where do those "NAN" and "INF" messages come from on the printf statements. Reply by e-mail or to the net as appropriate The opinions expressed herein are my own and do not reflect those of the Internal Revenue Service or any other agency of the United States Government. (A US Gov't disclaimer designed to protect the taxpayers from their fellow taxpayers) -- UUCP: (1) seismo!why_not!scsnet!sunder Mark E. Sunderlin (2) ihnp4!chinet!megabyte aka Dr. Megabyte CIS: 74026,3235 (202) 634-2529 Mail: IRS PM:PFR:D:NO 1111 Constitution Ave. NW Washington,DC 20224