Talk:Loops/Do-while

From Rosetta Code
Revision as of 06:31, 15 September 2009 by MikeMol (talk | contribs) (Possible rewording.)

self-contradictory task?

If value is supposed to start at "zero" and looping is to be performed "while value mod 6 is not equal to zero", then it follows that the loops should be executed zero times since 0 mod 6 == 0. Requiring that the loop should execute at least once is in conflict with the other requirements.Sgeier 04:54, 15 September 2009 (UTC)

I believe the goal is to demonstrate a post-execute condition check, but I don't have a good idea of precise-yet-clear ways to describe it, and that interpretation of the behavior is specific to imperative programming. "Process at least once, or while condition is true" might be closer. --Michael Mol 06:31, 15 September 2009 (UTC)