POV-Ray : Newsgroups : povray.general : Random integer : Re: Random integer Server Time
31 Oct 2024 19:32:31 EDT (-0400)
  Re: Random integer  
From: Mike Horvath
Date: 4 Feb 2016 21:45:53
Message: <56b40ce1$1@news.povray.org>
On 1/31/2016 11:27 PM, Sven Littkowski wrote:
> Yes, there are two functions to convert a float to a close-by integer:
>
> 1. Floor
> If the float is, let's say, "11.4676475" (could be a multiplication of a
> "rand" random result), floor returns "11" (the next integer BELOW that
> float).
>
> 2. Ceil(ing)
> If the float is, let's say, "11.4676475" (could be a multiplication of a
> "rand" random result), floor returns "12" (the next integer ABOVE that
> float).
>


There is also int, which varies depending on if the number is greater or 
less than zero.


Post a reply to this message

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