Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Michael S Newsgroups: comp.lang.c Subject: Re: Loops (was Re: do { quit; } else { }) Date: Wed, 16 Apr 2025 18:18:40 +0300 Organization: A noiseless patient Spider Lines: 24 Message-ID: <20250416181840.00003d96@yahoo.com> References: <20250413072027.219@kylheku.com> <20250415053852.166@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Wed, 16 Apr 2025 17:18:43 +0200 (CEST) Injection-Info: dont-email.me; posting-host="a5b6afe1e2db320795a254109bc9c05b"; logging-data="2364728"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/S9a30BAY5nBaqMBN2GnDE55ZiQhczH/k=" Cancel-Lock: sha1:+hl3QTqkUrKI7p98UnKmCr/Jcxo= X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32) On Wed, 16 Apr 2025 10:47:56 -0400 James Kuyper wrote: > bart writes: > >On 16/04/2025 06:35, Janis Papanagnou wrote: > > > > >So here, 0% of such loops have a step other than 1. THAT's what I > >mean by 'unusual'. > > The files easily accessible to me contain 13965 for statements, of > which 596 used a step other than 1. > In quoted statement "1" was meant to cover both +1 and -1. I would be surprised to find out that non-units strides are relatively common (say, above 0.1%) outside of several specialized fields, like linear algebra and image processing. There are yet other fields where we can encounter increments that are non-constant throughout duration of the loop. Bart would probably say that such loops do not count, in both senses. I.e. they are not counting loops, but forms of while loop.