Sujet : Re: Loops (was Re: do { quit; } else { })
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.cDate : 16. Apr 2025, 16:18:40
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250416181840.00003d96@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
On Wed, 16 Apr 2025 10:47:56 -0400
James Kuyper <
jameskuyper@alumni.caltech.edu> wrote:
bart <bc@freeuk.com> 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.