Re: Re: [HACKERS] random() function produces wrong range

From: Roland Roberts <roberts(at)panix(dot)com>
To: pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: Re: [HACKERS] random() function produces wrong range
Date: 2000-08-03 17:36:01
Message-ID: m2n1iuz1q6.fsf@tycho.rlent.pnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

Tom> Actually the odds are far better than that. If the range is
Tom> 2^31-1 then only about 2^-16th of the outputs should be less
Tom> than 2^15. So ten probes gives you a failure probability of
Tom> about 2^-160 not 2^-10.

Oops, 2^16 != 2^32 / 2.

So a dynamic test is not only possible but wouldn't cost to much at
configure time.

roland
- --
PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD Unix Software Solutions
roberts(at)panix(dot)com 76-15 113th Street, Apt 3B
rbroberts(at)acm(dot)org Forest Hills, NY 11375

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3a
Charset: noconv
Comment: Processed by Mailcrypt 3.5.4, an Emacs/PGP interface

iQCVAwUBOYmtf+oW38lmvDvNAQGWYwP/eXRtrDPu/xN+W9pCd9y34d4jbrPH7jku
nBAuSYtCRyoMgTkjdCtqThzq3vzPLDwfmOZcmWP8W5AmQPJjvcdFwI7y1XgGlaxd
aAIlqqf+TTkZwIUh2vnWTuu5JKkiAZI6UuzNSzy79O/frxKE2y97zCuMw02I0kMK
iGNSybN3L5w=
=36yP
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michaël Fiey 2000-08-03 17:45:24 Is union better than or
Previous Message luc00 2000-08-03 16:07:55 OFF topic : does anybody know free hosting with PgSQL & PHP

Browse pgsql-hackers by date

  From Date Subject
Next Message Roland Roberts 2000-08-03 17:40:13 RPM buglet, postgres-devel
Previous Message The Hermit Hacker 2000-08-03 16:23:47 Re: comparing rows