How not to write a loop

Doug Gwyn gwyn at brl-smoke.ARPA
Tue Mar 1 04:00:53 AEST 1988


In article <832 at unmvax.unm.edu> mike at turing.UNM.EDU.UUCP (Michael I. Bushnell) writes:
>	float x;
>	for (x = 0; x < 20; x += .5)
>		printf("%f\n", x);
>The output would, of course, be
>	0.0
	...
>	19.5

and, perhaps,
	20.0
(ignoring the nit that this isn't quite the format specified).

That is why the original poster didn't want to see such loop control
in putative portable programs.



More information about the Comp.lang.c mailing list