Re: How is Math.Random emulated? and how good is it?
Thanks, I'll try that other one and see if it helps.
My Application/Doddle is here:
http://www.darkflame.co.uk//Modoodler/Modoodler.html
If anyone is interested. Hitting Run Commandsd on the default settings
shows the bias.
On Jan 11, 3:21 pm, Chi Hoang <c...@chi.ca> wrote:
> java.lang.Math.random() calls the native javascript Math.random().
>
> However, java.util.Random implements the random number algorithm
> specified in the spec for that class - you can try using that if
> java.lang.Math.random() is not random enough
>
> On Jan 11, 6:19 am, Kevin Jordan <ke...@kjordan.net> wrote:
>
>
>
>
>
>
>
> > All GWT's emulation does is natively call the javascript
> > Math.random().
>
> > On Jan 11, 3:02 am, darkflame <darkfl...@gmail.com> wrote:
>
> > > I have been playing about drawing fractals in GWT using canvas and the
> > > ¨ chaos game¨ method.
>
> > > However when picking large amounts of random numbers I seem to be
> > > getting a bias. That is, the randomness doesn't seem evenly
> > > distributed.
> > > I have read many sources online that say that Javas normal
> > > Math.Random() is flawed for this stuff, and some alternatives are
> > > offered. However as GWTś Math.Random is merely an emulation, I
> > > wondered if it suffered the same flaws or not.
> > > Does anyone use alternative methods?
>
> > > This is all rather new too me, so if anyone has any pointers it would
> > > be helpfull.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home