×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    1

    Math.random() issue on e71

    I'm currently writing an app for my e71 which requires the Math.random function. However, I have found that each time I start up the app on the e71 it will produce the same sequence of random numbers. I have tried seeding it with Date().getTime() and Date().getSeconds(), and although it produces a different set of numbers, the sequence of numbers is still the same on startup.

    Has anyone had this issue before, and does anyone know how to resolve it?

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: Math.random() issue on e71

    Hello,

    Welcom to Forum Nokia dibo!

    Could you check the firmware version of the E71 (*#0000#)?

    I was able to reproduce the issue with N96 as well.
    Unfortunately the only workaround I can think of is implementing a custom pseudorandom function.

    Google returns a couple of Mersenne-Twister implementations in JS. Those could be worth of trying.

    Ilkka - FN

  3. #3
    Registered User
    Join Date
    Jun 2009
    Location
    Kuala Lumpur, Malaysia
    Posts
    13

    Re: Math.random() issue on e71

    Same same with n82.

    mindo

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Math.random() issue on e71

    Not a solution, but a possible workaround: you could try by multiplying the random generated number for the current Date milliseconds. This way the obtained numbers should be different each time the widget is executed.

    Pit

Similar Threads

  1. Shift issue on E71 qwerty keyboard
    By olhed in forum Symbian User Interface
    Replies: 4
    Last Post: 2009-07-01, 15:33
  2. App runs on N82, N95 but not on E71
    By NevenS in forum Symbian
    Replies: 4
    Last Post: 2009-03-12, 20:13
  3. E71 hacking issue
    By firosejinna in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2008-10-18, 12:41
  4. RTSP video streaming issue on 6280
    By olivier_irac in forum General Development Questions
    Replies: 0
    Last Post: 2006-12-04, 15:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×