Submitted issue #4372 (http://code.google.com/p/google-web-toolkit/ issues/detail?id=4372) for this problem.
On Dec 17, 1:13 pm, hemodroid <[email protected]> wrote: > No problem :) > > On 17 déc, 18:23, Brandon Tilley <[email protected]> wrote: > > > I apologize, hemodroid, upon further research I was able to replicate > > this using the version of nextInt() with no arguments: > > > public static native int nextInt() /*-{ > > // "~~" forces the value to a 32 bit integer. > > return ~~(Math.floor(Math.random() * 4294967296) - 2147483648); > > }-*/; > > > This code on Google Chrome (at least 4.0.249.43 for Mac) does indeed > > generate only even numbers. > > > On Dec 17, 9:20 am, Brandon Tilley <[email protected]> wrote: > > > > GWT Random uses the browser's underlying JavaScript math library to > > > generate random numbers: > > > > public static native int nextInt(int upperBound) /*-{ > > > // "~~" forces the value to a 32 bit integer. > > > return ~~(Math.floor(Math.random() * upperBound)); > > > }-*/; > > > > I ran a quick test of this code in Google Chrome for Mac (4.0.249.43) > > > and I received both even and odd numbers. If there really is a > > > problem, it should be with Chrome, not GWT. > > > > On Dec 17, 8:08 am, hemodroid <[email protected]> wrote: > > > > > I'd dont know about u, but i noticed that in my Google Chrome browser, > > > > GWT Random always generate even numbers. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
