Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!purdue!bu-cs!dartvax!eleazar.dartmouth.edu!ari From: ari@eleazar.dartmouth.edu (Ari Halberstadt) Newsgroups: comp.lang.c Subject: Re: floating point constants Message-ID: <14675@dartvax.Dartmouth.EDU> Date: 26 Jul 89 20:29:05 GMT References: <1925@arisia.Xerox.COM> Sender: news@dartvax.Dartmouth.EDU Reply-To: ari@eleazar.dartmouth.edu (Ari Halberstadt) Organization: Dartmouth College, Hanover, NH Lines: 17 In article <1925@arisia.Xerox.COM> leisner@arisia.Xerox.COM (Marty Leisner) writes: >Is this a valid C program? gcc 1.35 handles it fine on a sun386i -- >main() >{ > printf("%f\n", 1.0/0.0); > printf("%f\n", -1.0/0.0); > printf("%f\n", 0.0/0.0); >} Why on earth would anyone want to compile that :-)? I think it's quite legal C, but it's total giberish, since if the compiler compiled it, it would simply result in a divide by zero, which any normal maching would have a fit over. -- Ari Halberstadt '91, "Long live succinct signatures" E-mail: ari@eleazar.dartmouth.edu Telephone: (603)640-5687 Mailing address: HB1128, Dartmouth College, Hanover NH 03755