Re: win32 random number generator

Started by Merlin Moncureabout 21 years ago2 messagespatches
Jump to latest
#1Merlin Moncure
merlin.moncure@rcsonline.com

"Merlin Moncure" <merlin.moncure@rcsonline.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

Attachments:

fix_random.diffapplication/octet-stream; name=fix_random.diffDownload+1-1
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Merlin Moncure (#1)

"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:

"Merlin Moncure" <merlin.moncure@rcsonline.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