|
![](/i/fill.gif) |
Warp wrote:
> Dan P <dan### [at] yahoo com> 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
|
![](/i/fill.gif) |