Skip to content

soenneker/soenneker.utils.random

Repository files navigation

Soenneker.Utils.Random

A thread-safe random utility library

Installation

dotnet add package Soenneker.Utils.Random

Usage

// Returns an integer >= 5, and < 20
RandomUtil.Next(5, 20);
// Returns a double >= 5, and < 20
RandomUtil.NextDouble(5, 20);
// Returns a random number with a uniform and discrete distribution
RandomUtil.NextDecimalUniform(5, 20);