Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-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

pgsql-hackers by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group