Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alternative to Math.random()



Hello ...


I wrote:

dm> What's a good alternative random number generator
  > [to Math.random()]?


TB replied:

tb> I would guess you'd have to seed random with a call
  > to Math.srandom()

This didn't work for me.

Is there actually an "srandom()" function in JS? None
of the web references I've scanned seems to mention
it; indeed --if I've understood them correctly-- they
suggest that "random()" is supposed to get seeded
automatically by the browser.  *shrug*

Anyway, I've gone with DT's suggestion and directly
combined random()'s output with a  date.getMilliseconds().


Thanks for the replies,

Don
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.