Re: Quick "Random[]" question
- To: mathgroup at smc.vnet.net
- Subject: [mg41885] Re: Quick "Random[]" question
- From: Bill Rowe <listuser at earthlink.net>
- Date: Sun, 8 Jun 2003 06:45:47 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On 6/7/03 at 12:08 AM, drmajorbob-MathGroup3528 at mailblocks.com (Bobby Treat) wrote: >We'll never know, as the probability of it is infinitesimal (zero >theoretically, but in practice, infinitesimal). Actually, this may not be the case. The results of a call to Random with no arguments is a machine precision real. Since there is a finite number of machine precision numbers between any two other numbers, it follows the probability of anyone of them is 1/n where n = 2^(number of bits in the mantissa of a machine real) ~ 1/$MachineEpsilon (assuming well written code). The only issue I cannot address is whether the code specifically excludes 0.0 and 1.0 So; >But plan for the possibility. That is, don't write code that breaks >if it happens. is good advice