Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ukma!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: floating point constants Message-ID: <10623@smoke.BRL.MIL> Date: 28 Jul 89 19:41:41 GMT References: <1925@arisia.Xerox.COM> <660047@hpclwjm.HP.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 12 In article <660047@hpclwjm.HP.COM> walter@hpclwjm.HP.COM (Walter Murray) writes: >Under ANSI C, I think it's clear that the following program is >valid, and prints the value 1. >main() { printf("%d\n", 2.0||1.0/0.0); } I think that's right. (I remember the discussion but not the outcome!) But if there is a division by zero in a context where a constant-expression is required (e.g. array bound) then I think it's a compile-time violation. Really, I hope people don't try to write applications that depend on divide-by-zero behavior. They're just asking for the trouble that they'll undoubtedly eventually get.