POV-Ray : Newsgroups : povray.documentation.inbuilt : revisiting rand(...) : Re: revisiting rand(...) Server Time
28 Sep 2021 15:34:35 EDT (-0400)
  Re: revisiting rand(...)  
From: Bald Eagle
Date: 17 Jul 2018 12:10:00
Message: <web.5b4e14a214e7ffacc437ac910@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> Le 18-07-17 à 06:27, Kenneth a écrit :
> > I'm wondering about the documentation for rand(...).

> All values are equally possible, including 0 and 1. The mantissa for a
> float is about 52 bits IIRC, so, you have a 1 in 2^52 chances of getting
> a 0 and the same of getting a 1. Very small but not zero chance.

So then maybe round to the nearest Q decimal place to "compress" the range and
increase the likelihood of getting a 1 or a 0.

See this post in an old thread:
http://news.povray.org/povray.newusers/message/%3C51fb4924%241%40news.povray.org%3E/#%3C51fb4924%241%40news.povray.org%
3E


Post a reply to this message

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