Because I originally got it all from you and SteveV!
(some sort of chicken/egg situation?)
----------
The range of Ayn Rand; oh, that's a different egg (goose?)
-----------------------------------------------------------
With best wishes from: John H Meyers <jhme...@mum.edu>
Sent via Deja.com
http://www.deja.com/
The RAND algorithm is:
if seed= 0 then seed= 0999500333083533 (not prime)
seed= seed*2851130928467 mod 10^15 (a prime number: call it P:-)
result = (seed mod 10^12)*10^-12
now to answer your questions (what are the max and min numbers RAND can
generate).
The Max is <= 0.999999999999 (but might not be equal to it) because the
result is not computed with rounding but by truncating.
To find the min and max, you will have to find the min and max numbers that
validate this equation
(x*P div 1000) in Z/10^12Z
(I let this question to the mathematicians around here...)
regards, Cyrille
"Joseph K. Horn" <joe...@jps.net> wrote in message
news:95qaov$bms$1...@nnrp1.deja.com...
> The RAND function common to the HP48, 49, 38, 39, 40, 71, etc, is often
> described as being able to output zero, but some sources disagree.
> Likewise, there is disagreement about whether it can output 1 or not.
>
> Here's the definitive scoop:
>
> 1E-15 <= RAND <= 0.999999999999
>
> In other words, RAND can NEVER output zero or one during normal use.
> If any of your books or manuals have it wrong, correct 'em.
>
> I think the fastest way to see the lower limit is this:
> 5.1368411713E47 RDZ and then press RAND four times.
> (RAND is in the MTH NXT PROB menu on the 48G and 49G)
>
> There are many ways see the upper limit; here's one way:
> 1.38022832628E58 RDZ RAND
>
> Apologies to John Meyers if he already covered this! :-)
>
> -Joe-