]> granicus.if.org Git - postgresql/commitdiff
Fix broken lrand48() implementation, per Merlin Moncure.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 23 Aug 2005 13:31:11 +0000 (13:31 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 23 Aug 2005 13:31:11 +0000 (13:31 +0000)
src/port/rand.c

index ca1d621fca758590f818090e3620f21a78bdd5fd..b4631299e999a699ffbe6964850951eed8540804 100644 (file)
@@ -63,7 +63,7 @@ long
 lrand48(void)
 {
        _dorand48(_rand48_seed);
-       return ((long) _rand48_seed[2] << 15) + ((long) _rand48_seed[1] > 1);
+       return ((long) _rand48_seed[2] << 15) + ((long) _rand48_seed[1] >> 1);
 }
 
 void