POV-Ray : Newsgroups : povray.general : Random integer : Re: Random integer Server Time
22 Jun 2025 08:20:52 EDT (-0400)
  Re: Random integer  
From: Mike Horvath
Date: 4 Feb 2016 21:50:15
Message: <56b40de7$1@news.povray.org>
On 1/31/2016 10:16 PM, clipka wrote:
> Am 01.02.2016 um 03:10 schrieb clipka:
>> 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
>
> ... provided you figure out that you need to add n ;)
>
> Oops.
>

Where do I add n?


Post a reply to this message

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