Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Too Large Positional Contributions to Score

Author: Robert Hyatt

Date: 06:58:54 03/08/99

Go up one level in this thread


On March 08, 1999 at 02:53:58, David Blackman wrote:

>On March 08, 1999 at 01:36:56, Peter McKenzie wrote:
>
>>On March 07, 1999 at 23:37:39, Peter McKenzie wrote:
>>
>>>On March 07, 1999 at 23:29:31, Stuart Cracraft wrote:
>>>
>>>>Crafty seems to have a Scale_Up/Scale_Down factor and I'm curious
>>>>if Bob would talk a little about this. Seems costly to add a memory
>>>>reference and a division (?).
>>>
>>>I'm guess his divisions are usually by a constant that is a multiple of 2, in
>>
>>oops, I meant power of 2 ...
>>
>>>which case the compiler will just do a bit shift.
>
>Not if you're using signed integers. The way the IEEE recommends to do signed
>integer division and the way most chips and compilers do it is to round towards
>0. Right shift rounds towards -infinity. Because of the difference, most
>compilers don't do this optimisation for signed numbers.
>
>Of course Bob might use unsigned integers here. I haven't looked at his code.


I don't follow.  positive ints approach zero with right shifts.  Negative ints
approach -1 with right shifts, since most processors that I know of have both
logical _and_ arithmetic (sign preserving) shifts...

the only glitch is that -1 >> 1 is not zero.  But I am not doing this kind of
stuff anyway... I am going indirect through an array to scale values.



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.