POV-Ray : Newsgroups : povray.general : Random integer : Re: Random integer Server Time
16 May 2024 13:25:37 EDT (-0400)
  Re: Random integer  
From: Sven Littkowski
Date: 31 Jan 2016 23:28:05
Message: <56aeded5$1@news.povray.org>
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).


Post a reply to this message

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