Author: Brian Kostick
Date: 17:10:55 04/09/04
Go up one level in this thread
>>On April 09, 2004 at 18:04:10, Russell Reagan wrote: >> >>>for (row = 11; row < 12; row--) >>> >>>The problem is the comparison: row < 12 >On April 09, 2004 at 19:32:54, Brian Kostick wrote: >>Looks like nasty code to me. row will soon go negative and stay there for quite >>some time. Maybe I'm not thinking clearly? BK On April 09, 2004 at 19:44:10, Russell Reagan wrote: > >row is unsigned :) So yes, it is nasty code, because it is not immediately >obvious what is happening, and I'm relying on the unsigned wrap around (for >example: row = 0; row--; now row == 4294967295). If I was writing this for >something that I planned on using I wouldn't have written it that way. I think obvious enough for programmers here. approximately unsigned int * 2 interations. I can't comment if that is defined behavior or not, so I won't. Even without printf and putchar that might take a time. I agree that if you feel the compiler generated bad code someone should look into it. BK
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.