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 18:57:56 EDT (-0400)
  Re: unnecessary int to float to int conversion  
From: Vadim Sytnikov
Date: 27 Jan 2003 16:19:42
Message: <3e35a26e@news.povray.org>
"ABX" <abx### [at] abxartpl> wrote:
>
> bbox.cpp:
>   maxfinitecount += maxfinitecount / 2;
>
> bsphere.cpp:
>   maxelements += maxelements / 2;
>
> where '/2' on ints is often calculated using bits operations seems useful.

Not in this case. '/2' and '>>1' are only equivalent for unsigned values
(although this can also be applied to signed variables known [by the
compiler] to contain positive values).


Post a reply to this message

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