Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!ames!hc!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.c Subject: Re: "for" loops Message-ID: <8544@lanl.gov> Date: 28 Jan 89 23:54:02 GMT References: <9527@smoke.BRL.MIL> Organization: Los Alamos National Laboratory Lines: 16 From article <9527@smoke.BRL.MIL>, by gwyn@smoke.BRL.MIL (Doug Gwyn ): > In article <8515@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >> for (x=0.0; x<=1.0, x+=0.1) {...} >>For a loop from 0.0 to 1000.0 by 0.01 on a 32-bit floating-point machine, >>the round-off of the last 100 adds is comparable to the increment itself! >> [...] > > No, I don't think so. I've never known anyone to recommend a loop > like the above. [...] I know of at least one person who recommended such a loop - the person I was originally responding to. He felt that the above loop was a clear advantage over what Fortran DO loops could do. He was wrong on both counts (Fortran CAN do it and it's not an improvement). J. Giles