gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] empty_corner_value on smaller boards


From: Gunnar Farneback
Subject: Re: [gnugo-devel] empty_corner_value on smaller boards
Date: Tue, 20 Nov 2001 18:28:30 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Teun wrote:
> > +  int empty_corner_value = EMPTY_CORNER_VALUE * board_size/19;
> 
> Shouldn't this read board_size/((float) 19)  ?

Technically it makes no difference. Since * and / have the same
precedence and are left-associative, a*b/c equals (a*b)/c. Furthermore
an integer division equals a floating point division which is followed
by a conversion to an int (at least if we limit ourselves to positive
numbers).

It may still be a good idea to make the expression clearer. But I
think

  int empty_corner_value = (EMPTY_CORNER_VALUE * board_size) / 19;

would be a cleaner solution.

/Gunnar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]