Re: Re: [GENERAL] random() function produces wrong range - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [GENERAL] random() function produces wrong range
Date
Msg-id 15268.965527521@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [GENERAL] random() function produces wrong range  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: LIKE/ESCAPE implementation
Next
From: Tom Lane
Date:
Subject: Re: COALESCE implementation question