On 19 Mar 2001, Joaquin Cuenca Abela wrote:

> On 19 Mar 2001 14:04:57 +0400, Vlad Harchev wrote:
> >
> > Then the following could be used to multiply 'x' by 1.5:
> >       (x + x<<1) >> 1
> > 
> > I will be very fast.

 Hmm, that would be better written as
        x + x>>1
 That will definitely be faster than x*1.5
 
> uhm, it's not so readable as x = x * 1.5.  In addition, if later we
> decide to change from 1.5 to something else, it becomes harder.  And in

 We may decide not to change it simply..

> addition I don't think that this "optimization" is need at all (of
> course, some figures will shut me down).

 As for whether it will help at all - I doubt that too - those 4+ saved CPU
cycles won't change anything..

> Cheers,
> 
> -- 
> Joaqu�n Cuenca Abela
> [EMAIL PROTECTED]
> 

 Best regards,
  -Vlad


Reply via email to