Re: [HACKERS] random_fract and aix compiler bug

From: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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-18 03:54:14
Message-ID: 46C15C39FEB2C44BA555E356FBCD6FA4962047@m0114.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


> ! } 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

yes, ugly :-(

> compiler manage not to choke if we add a cast instead?
>
> } while (!(z > 0 && z < (long) MAX_RANDOM_VALUE));
>

this does unfortunately not help, have also tried all sorts of other casts :-(

Would we be happy with the following, which would work ?

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

Andreas

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2003-10-18 04:32:33 minor psql cleanup
Previous Message Neil Conway 2003-10-18 03:47:22 fix memory leak in libpq