Re: [HACKERS] random_fract and aix compiler bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] random_fract and aix compiler bug
Date: 2003-10-17 17:17:40
Message-ID: 24808.1066411060@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

"Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at> writes:

! } while (!(z > 0 && z < MAX_RANDOM_VALUE));

! } while (z == 0 || z == MAX_RANDOM_VALUE);

This seems fairly ugly, since it eliminates the original coding's
positive guarantee that the final result is in 0 < x < 1. Does your
compiler manage not to choke if we add a cast instead?

} while (!(z > 0 && z < (long) MAX_RANDOM_VALUE));

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2003-10-17 17:40:50 Re: [HACKERS] random_fract and aix compiler bug
Previous Message Zeugswetter Andreas SB SD 2003-10-17 15:26:46 [HACKERS] random_fract and aix compiler bug