Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU From: MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU Newsgroups: comp.lang.c Subject: Undelivered mail Message-ID: <12259@brl-adm.ARPA> Date: 12 Mar 88 05:19:17 GMT Sender: news@brl-adm.ARPA Lines: 32 Subject: Re: How not to write a loop [Non-Deliverable: User does not exist or has never logged on] Reply-To: Info-C@BRL.ARPA Received: From UWAVM(MAILER) by ALASKA with Jnet id 6452 for SXJVK@ALASKA; Fri, 11 Mar 88 19:44 AST Received: by UWAVM (Mailer X1.25) id 4316; Fri, 11 Mar 88 20:43:52 PST Date: Thu, 10 Mar 88 13:36:07 GMT Reply-To: Info-C@BRL.ARPA Sender: Info-C List From: Gerald Edgar Subject: Re: How not to write a loop Comments: To: info-c@brl-smoke.arpa To: Vic Kapella Lengthy discussion about loops such as: >>> float x; >>> for (x = 0; x < 20; x += .5) printf("%f\n", x); How about this: float x; for (x = 0; x < 19.75; x += .5) printf("%f\n", x); -- Gerald A. Edgar TS1871@OHSTVMA.bitnet Department of Mathematics gae@osupyr.UUCP The Ohio State University ...{akgua,gatech,ihnp4,ulysses}!cbosgd!osupyr!gae Columbus, OH 43210 70715,1324 CompuServe