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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [GENERAL] random() function produces wrong range
Date: 2000-08-06 02:05:21
Message-ID: 15268.965527521@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> rand() and RAND_MAX are defined by ANSI C, random() is a BSD-ism. I
> suggest you use the former.

Unfortunately, except on a few platforms like Linux, the typical
rand() implementation is vastly inferior to the typical random()
implementation.  BSD wouldn't have bothered to roll their own if
the older code hadn't been so godawful.  But unless you are using
glibc, you probably have a bug-compatible rand().

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-08-06 02:19:56
Subject: Re: Quoting fun
Previous:From: Tom LaneDate: 2000-08-06 01:54:27
Subject: Re: comparing rows

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