Random of zero

Shari gypsyware at earthlink.net
Tue May 13 08:31:01 EDT 2003


>It is clear that you read the MetaTalk entry for random, and 
>likewise it is clear that you chose to try to use the function 
>outside of its clearly documented scope.

The assumption that random(0) would obviously be 0 was made based on 
general principles.  Not on Metatalk itself.  I did not expect to 
have to look up what would seem to be a simple function.

It was not until the handler failed, and I discovered that random(0) 
consistently produces 1, that I looked it up in the reference docs to 
see if there was an explanation, and some way to fix it to produce 0 
as I intended it to.

I do not know in general mathematical principles, what result one 
would get from random(0).  But I would expect it to be 0.  My mistake 
for assuming.  (Unless of course, general math principles support my 
theory :-)

Any math gurus out there know?

:-)

Shari C
-- 
--Shareware Games for the Mac--
http://www.gypsyware.com



More information about the metacard mailing list