Random musings

There might be some actual content here in the future...

PCG random number generator for .net

Due to one of my side projects needing to do Monte Carlo simulations, I was looking for a better random number generator than what the default Random class in .net offers. Unfortunately, I could not find any good ready-made random number generators for C#, so I decided to port the PCG random number generator to C#.

My pcg-random-csharp project implements the minimal C version of the PCG generator with the same interface as the default Random class. Thanks to this, it can be used as a direct drop-in replacement for the Random class in existing code without any modifications. The implemented generator has 64-bit internal state, and it produces 32-bit random numbers. By using the Pcg32(ulong state, ulong sequence) constructor, users can decide what random sequence they want to use. Please check the official PCG documentation on how the actual algorithm works.


New site and blog

At last, a new site and a blog for me. Although it’s still under construction (and changes are coming), everything on this site should behave somewhat correctly.

So whats this site about? It’s going to be my personal site, where I’m going to write about IC/harware design and programming as thats where my interests lie. Updates will be sporadic, propably one blog post per month or two. For this year the target is to write at least ten blog posts. Additionally I will be sharing some of my (bad) photographs in full resolution (see photos section) for those who don’t like flickr or 500px.