Inconsistent rand() results with MySQL Ruby (long)

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Re: Inconsistent rand() results with MySQL Ruby (long)

    At 5:26 +0900 6/26/03, Dave Dembinski wrote:

    [summary: ORDER BY RAND() * 10 doesn't seem very random]



    What's your version of MySQL? A change was made in 3.23.56 to intialize
    the randomizer better.

    Paul DuBois Guest

  2. Similar Questions and Discussions

    1. Inconsistent bandwidth detection results using peldibwcheck
      Hello I've implemented this bandwidth checker http://www.adobe.com/devnet/flashcom/articles/flvideo_bandwidth_print.html reccommended by adobe,...
    2. Recordset returning inconsistent results
      I am developing a php site using mysql and apache. I have finally managed to get a database connection and am trying now to create some...
    3. #25694 [Ver->Csd]: round() and number_format() give inconsistent results.
      ID: 25694 Updated by: iliaa@php.net Reported By: russ at kdimail dot com -Status: Verified +Status: ...
    4. #25694 [Opn->Ver]: Round and number_format give inconsistent results.
      ID: 25694 Updated by: sniper@php.net Reported By: russ at kdimail dot com -Status: Open +Status: ...
    5. #25694 [NEW]: Round and number_format give inconsistent results.
      From: russ at kdimail dot com Operating system: RedHat Linux 7.3 PHP version: 4.3.3 PHP Bug Type: *Math Functions Bug...
  3. #2

    Default Re: Inconsistent rand() results with MySQL Ruby (long)

    Paul DuBois <paul@snake.net> wrote in message news:<p05210624bb20cc97d5c0@[192.168.0.34]>...
    > At 5:26 +0900 6/26/03, Dave Dembinski wrote:
    >
    > [summary: ORDER BY RAND() * 10 doesn't seem very random]
    >
    >
    >
    > What's your version of MySQL? A change was made in 3.23.56 to intialize
    > the randomizer better.
    Aha! I've 3.23.55. Well, I guess that explains part of the problem.
    I want to thank everyone for helping, and it's now working somewhat
    the way I want it. Instead of relying on rand() by itself I'm passing
    it a seed composed of a number generated by ruby's rand() and the
    current system time in seconds, and that's giving me some comfortably
    random results.

    _dave
    Dave Dembinski Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139