POV-Ray : Newsgroups : povray.programming : POV-Ray 3.5 for AmigaOS : Re: Bah. Server Time
3 Jul 2024 05:53:51 EDT (-0400)
  Re: Bah.  
From: Dan P
Date: 3 Jun 2004 19:15:19
Message: <40bfb107$1@news.povray.org>
Warp wrote:
> Dan P <dan### [at] yahoocom> wrote:
> 
>>Those warnings bug me, so I'm going to fix them. As a rule, I use 
>>floor() and cast it to an int when I'm going from a double to an 
>>integer.
> 
> 
>   By doing that you will be slowing down the code.
> 
>   This: "int i = some_double;" is equivalent to this:
> "int i = int(some_double);".
>   However, you are adding an additional 'floor()' call which will
> slow down the conversion needlessly.
>   It will also probably give a different result with negative numbers.
> 

That makes sense.

-- 
Respectfully,          "Leave it to the coward to make a religion
Dan P            of his cowardice by preaching humility."
                                    - George Bernard Shaw
http://<broken link>


Post a reply to this message

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