POV-Ray : Newsgroups : povray.programming : unnecessary int to float to int conversion : Re: unnecessary int to float to int conversion Server Time
8 Jul 2024 19:49:40 EDT (-0400)
  Re: unnecessary int to float to int conversion  
From: Thorsten Froehlich
Date: 28 Jan 2003 13:02:42
Message: <3e36c5c2$1@news.povray.org>
In article <3e36ba51@news.povray.org> , "Vadim Sytnikov" <syt### [at] rucom>
wrote:

>>   The compiler will always generate a shift opcode for integer/2,
>> regardless of whether 'integer' is signed or unsigned. Processors
>> have two kinds of shift right opcode for this.
>>   IIRC, this applies to integer>>1 as well. Thus they are
>> completely equivalent.
>
> Well, they are *not* equivalent.

They are equivalent in the sense Warp means it also he didn't put it very
well in what sense he means it :-)

There are logical and arithmetic shift instructions which work for signed
and unsigned shifts no matter what direction.  No need to make a big fuss
about it ;-)

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.