On Thursday, 22 December 2022 at 16:23:16 UTC, jwatson-CO-edu
wrote:
What is the reason for this? Has the compiler optimized away
the `uniform` call to a single double number?
What is the main difference between Program 1 and Program 2?
Both seem to:
* Have a global RNG `rnd`
* Seed RNG after
On 12/22/22 11:23 AM, jwatson-CO-edu wrote:
I am confused about why Program 1 produces random output but Program 2
does not.
---
### Program 1
```d
import std.stdio;
import std.conv;
import std.random;
Mt19937 rnd;
double rand01(){
// Uniform random sampling in [0,1)
return
On Thu, Dec 22, 2022 at 08:17:56PM +, jwatson-CO-edu via
Digitalmars-d-learn wrote:
> On Thursday, 22 December 2022 at 17:33:48 UTC, Paul Backus wrote:
> > So, as far as I can tell, there is nothing wrong with your code, and
> > the random number generator is working as intended.
> >
> >
On Thursday, 22 December 2022 at 17:33:48 UTC, Paul Backus wrote:
So, as far as I can tell, there is nothing wrong with your
code, and the random number generator is working as intended.
Most likely you have made a mistake somewhere in the part of
the code that you did not post, and that
On Thursday, 22 December 2022 at 16:23:16 UTC, jwatson-CO-edu
wrote:
I am confused about why Program 1 produces random output but
Program 2 does not.
The code you have posted as "Program 2" is incomplete, and cannot
be compiled as-is. I have made some changes in order to get it to
compile
I am confused about why Program 1 produces random output but
Program 2 does not.
---
### Program 1
```d
import std.stdio;
import std.conv;
import std.random;
Mt19937 rnd;
double rand01(){
// Uniform random sampling in [0,1)
return uniform( 0.0, 1.0, rnd);
}
void main(){
rnd =
On Thursday, 22 December 2022 at 15:32:28 UTC, Anonymouse wrote:
I'm not sure what to do.
If it links on Ubuntu, but not on Manjaro/Arch, then is it
possible that the GDC package from Manjaro/Arch is somehow
provided with a missing, misconfigured or broken Phobos library?
Maybe try to
On Tuesday, 20 December 2022 at 20:55:08 UTC, Paul Backus wrote:
Apologies for the late reply.
On Tuesday, 20 December 2022 at 20:01:04 UTC, Anonymouse wrote:
What does `-allinst` even do
`-allinst` tells the compiler to generate code for all
instantiated templates, even if it thinks that