mir.random - my GSoC project

HaraldZealot via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 3 05:03:32 PDT 2016


On Thursday, 2 June 2016 at 10:56:36 UTC, Martin Nowak wrote:
> On 04/23/2016 04:17 PM, Seb wrote:
>> This project is about adding non-uniform random generators to 
>> mir and hopefully eventually to Phobos.
>
> I just happen to need a gaussian random number generator right 
> now. Is there already some WIP code, or would you have an 
> intermediate recommendation?

Is good workaround you can use:
```d
real normalrnd(real mu, real sigma)
{
     import std.random: uniform;
     import std.mathspecial: normalDistributionInverse;

     return mu + sigma * normalDistributionInverse(uniform(0.0L, 
1.0L));
}
```



More information about the Digitalmars-d mailing list