Table of Contents

Class RandomExtensions

Namespace
Fantas
Assembly
Fantas.dll

Random extension methods

public static class RandomExtensions
Inheritance
RandomExtensions
Inherited Members

Properties

Random

Global random generator

public static Random Random { get; set; }

Property Value

Random

Methods

NextDouble(Random, double)

Get the next double up to max value

public static double NextDouble(this Random random, double max)

Parameters

random Random
max double

Returns

double

NextFloat(Random)

Next float value (0f - 1f)

public static float NextFloat(this Random random)

Parameters

random Random

Returns

float

NextFloat(Random, float)

Get the next float up to max value

public static float NextFloat(this Random random, float max)

Parameters

random Random
max float

Returns

float

Range(Random, double, double)

Returns a random float between min (inclusive) and max (exclusive)

public static double Range(this Random random, double min, double max)

Parameters

random Random
min double
max double

Returns

double

Range(Random, int, int)

Returns a random integer between min (inclusive) and max (exclusive)

public static int Range(this Random random, int min, int max)

Parameters

random Random
min int
max int

Returns

int

Range(Random, float, float)

Returns a random float between min (inclusive) and max (exclusive)

public static float Range(this Random random, float min, float max)

Parameters

random Random
min float
max float

Returns

float