Re: random() function produces wrong range - Mailing list pgsql-general

From Mike Sears
Subject Re: random() function produces wrong range
Date
Msg-id 002b01bffc07$907fd2d0$02945bd1@neutrino
Whole thread Raw
In response to Re: random() function produces wrong range  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: random() function produces wrong range  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
What build of postgres is this running on. I've tried this on 6x and it
doesn't seem to work.


----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Stephan Szabo" <sszabo@megazone23.bigpanda.com>
Cc: <pgsql-hackers@postgreSQL.org>; <pgsql-general@postgreSQL.org>
Sent: Tuesday, August 01, 2000 11:23 AM
Subject: Re: [GENERAL] random() function produces wrong range


> Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> > Actually, on my machines, both man pages for rand() and random() say
> > they return values between 0 and RAND_MAX (whether that's true or not
> > is another matter).  In my case RAND_MAX==INT_MAX so the change wouldn't
> > be a problem, but it might be problematic on some of the 64 bit
machines.
>
> Oh, that's interesting.  What platform do you use?  If RAND_MAX applies
> to random() on some machines that'd probably explain why the code is
> written like it is.  But on my box (HPUX) the rand() function is old
> and crufty and considerably different from random().
>
> regards, tom lane
>


pgsql-general by date:

Previous
From: "Fetter, David M"
Date:
Subject: RE: Postgres connect with Access
Next
From: Tom Lane
Date:
Subject: Re: random() function produces wrong range