Re: win32 random number generator

Lists: pgsql-hackers-win32pgsql-patches
From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-patches(at)postgresql(dot)org>, <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: win32 random number generator
Date: 2005-08-23 12:14:21
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3417DD177@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32 pgsql-patches

> "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com> writes:
> > Looks like this in lrand48(void):
_rand48_seed[1] > 1);

> > _rand48_seed[1] >> 1);
^^

The problem is the shift operator :). Anyways I double checked the
results and it works as expected now so here's a patch. I also removed
the spurious casts.

Merlin

Attachment Content-Type Size
fix_random.diff application/octet-stream 353 bytes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org, pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: win32 random number generator
Date: 2005-08-23 13:26:16
Message-ID: 1700.1124803576@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32 pgsql-patches

"Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com> writes:
> "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com> writes:
>> Looks like this in lrand48(void):
>> _rand48_seed[1] > 1);

>> _rand48_seed[1] >> 1);
>> ^^

> The problem is the shift operator :).

Ah, missed that completely in looking at the casts. Will fix.

regards, tom lane