On Wed, 2008-04-23 at 15:14 +0100, Brian Gough wrote:
> I've played with a few variations and found that the alternative
>
> for (i = N; i-- > 0;)
Bah. I would just use the simple version he suggests
> > for (i = 0; i < N; i++) { j = N - i; ... }
The extra variable is perfectly reasonable.
> I never really liked code that depends on the distinction between --i
> and i--, being burned a few times by subtle bugs from not noticing the
> wrong one being used, hence the tendency to write things like i>0 &&
> i--.
I agree. The simple version is the best though.
--
G. Jungman
_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl