Author: Dieter Buerssner
Date: 14:03:53 08/08/03
Go up one level in this thread
On August 08, 2003 at 16:51:52, Gerd Isenberg wrote: >On August 08, 2003 at 16:30:22, Dieter Buerssner wrote: > >>On August 08, 2003 at 16:15:26, Gerd Isenberg wrote: >> >>>Btw. if your row function is unsigned, it may cheaper to ask: >>> >>> if( (row(u)-1) < (7-1) ) >> >>Hmm, shouldn't it be >> if( ((unsigned)row(u)-2) < (7-2) ) > >Hi Dieter, > >is the unsigned cast necessary if row(int) is unsigned? No. But I just wanted to emphasize it. >Ahh i see, macros instead of inlines ;-) And make it independent from the prototype of row or the exact macro. I think, here is not much difference between macro and function. Actually, for something like row, I think there is not much need, to avoid a macro. In some cases, it might be more efficient (for example, when some type promotion would be needed for the argument in function version) >The original statement was for row 0..7 i guess > > if( row(u) != 0 && row(u) != 7 ) { >or > if( row(u) > 0 && row(u) < 7 ) { >if i subtract 1, 0 becomes UINT_MAX and 7 becomes 6. >So below 6 or 7-1 seems correct to me. Gerd, you are of course right. I don't know, what I was thinking (actually I almost know, but it is too embarrassing to spell it out :-). Regards, Dieter
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.