Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Speed of certain operations

Author: Dave Gomboc

Date: 20:01:38 06/16/99

Go up one level in this thread


On June 16, 1999 at 22:56:02, Greg Lazarou wrote:

>Hi James,
>
>I don't have the straight answer to your question but if x is an integer then
>multiplications by 2 and divisions by 2 (the 4th and 2nd cases respectively)
>should be very fast left and right shifts. Now you can let the compiler figure
>it out (and you may be able to help the compiler figure it out by expressing
>x*=.5 as x /= 2) or you can code it as a shift yourself...

N.B. (x /= 2) == (x >> 1) iff (x is unsigned)

Dave



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.