POV-Ray : Newsgroups : povray.general : Random integer : Re: Random integer Server Time
16 May 2024 01:43:19 EDT (-0400)
  Re: Random integer  
From: Thomas de Groot
Date: 1 Feb 2016 03:06:33
Message: <56af1209$1@news.povray.org>
On 1-2-2016 3:10, clipka wrote:
> Am 01.02.2016 um 02:55 schrieb Mike Horvath:
>> How do I calculate a random integer between n and p, inclusively?
>
> floor( rand(R)*((p-n)+1) + 0.5 )
>
> should do the trick
>

Why not this: int(RRand(n,p,R))

-- 
Thomas


Post a reply to this message

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