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.


Reply via email to