Random double
bearophile
bearophileHUGS at lycos.com
Tue Apr 23 13:59:41 PDT 2013
qznc:
> I want to generate a random "double" value, excluding wierdos
> like NaN and Infinity. However, std.random.uniform seems to be
> useless.
Can you explain why you need uniform doubles in their whole
range? I think I have never had to generate them so far. Maybe
for a unittest?
Also note by their nature doubles are not equally spread across
the line of Reals, so getting a truly uniform distribution is
hard or impossible.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list