Why so many collisions with the MariaDB 10.2 RAND() function?

前端 未结 1 1420

Note: Running MariaDB 10.2.27 on Windows Server 2012 R2 Standard.

I wanted to generate random integers for use in MariaDB so I have been experimenting with the MariaDB R

1条回答
  •  醉话见心
    2021-01-28 16:36

    Further experiments with 5.6's RAND indicate that it is good to only 30 bits. That is it has only about one billion distinct values.

    File a bug with bugs.mysql.com and/or MariaDB.

    30 bits is good enough for most applications. Of those applications for which it is not good enough, most people won't notice its wimpiness.

    FLOAT has 24 bits of precision; DOUBLE has 53. So 30 needs DOUBLE, but fails to fill it up.

    0 讨论(0)
提交回复
热议问题