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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

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