POV-Ray : Newsgroups : povray.general : Random integer : Re: Random integer Server Time
31 Oct 2024 19:38:39 EDT (-0400)
  Re: Random integer  
From: William F Pokorny
Date: 4 Feb 2016 22:53:30
Message: <56b41cba$1@news.povray.org>
On 02/04/2016 09:49 PM, Mike Horvath wrote:
> On 2/1/2016 10:30 AM, William F Pokorny wrote:
>
> So should I use int or floor? The result is different for numbers below
> zero.
>
> Mike

Good question. If you have negative integers as part of your potential 
integer range, use floor().

Aside: In some languages to really get an integer you need int() too as 
in : int(floor(...)) because ceil() and floor() in those languages 
return floats.

Bill P.


Post a reply to this message

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