Deutsch   English   Français   Italiano  
<vtohfp$2db8v$3@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: Loops (was Re: do { quit; } else { })
Date: Wed, 16 Apr 2025 16:14:03 +0100
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <vtohfp$2db8v$3@dont-email.me>
References: <vspbjh$8dvd$1@dont-email.me> <20250413072027.219@kylheku.com>
 <vtgpce$39229$1@dont-email.me> <vti2ki$g23v$1@dont-email.me>
 <vtin99$vu24$1@dont-email.me> <vtiuf0$18au8$1@dont-email.me>
 <vtj97r$1i3v3$1@dont-email.me> <vtl166$36p6b$1@dont-email.me>
 <vtlcg0$3f46a$2@dont-email.me> <20250415053852.166@kylheku.com>
 <vtm4ae$6d5j$1@dont-email.me> <H7yLP.2056536$OrR5.1414451@fx18.iad>
 <vtmgj8$g81k$1@dont-email.me> <vtnfjj$1gk91$1@dont-email.me>
 <vto4fu$23kmr$1@dont-email.me> <vtofus$2bntf$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 16 Apr 2025 17:14:02 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="507c987f563baeac8cb4b74b82477869";
	logging-data="2534687"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/gWwpjoBgLyiUnOem/6mZm"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:px68Hi9hfD5gijW1Y7SUZwy3WPc=
In-Reply-To: <vtofus$2bntf$1@dont-email.me>
Content-Language: en-GB
Bytes: 2574

On 16/04/2025 15:47, James Kuyper 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.

(I assume you mean other than +1 or -1.)

So about 4%. What tool did you use to determine that?

If I look at sql.c (which includes sqlite3.c), there are 1900 
for-statements.

Among those, 40 involve += or -=, usually in the increment part, however 
I didn't look too closely. I didn't look for ones like i=i+2.

That would be 2% of the total. But the loops include a substantial 
proportion of fanciful for-headers, and the odd increment might relate 
to those.

Still, I was replying to someone suggesting my claim of "Any step other 
than 1 is unusual." was "Nonsense".

I suggest that 2-4% incidence is 'unusual'. In the two smaller programs 
I also looked at, of which I reported one, the incidence was 0% among 
/simple iterations/.