(3) I wish that the maximum implied multiplier could be explicitely
documented in the source code. From pg_rand48 source code, I think
that it is 33.27106466687737
Small possibly buggy code attached, to show how I computed the above
figure.
--
Fabien.
#include <math.h>
#include <stdio.h>
int main(void)
{
double v = ldexp(0xffff, -48) + ldexp(0xffff, -32) + ldexp(0xffff, -16);
double u = 1.0 - v;
double m = -log(u);
printf("v=%.16g u=%.16g m=%.16g\n", v, u, m);
}
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers