2 added 11 characters in body
source | link

Why do languages' random number generators tend to return a value exclusive of the upper bound of the range?

For example, an implicit range -

JavaScript's random()random() method "Return a random number between 0 (inclusive) and 1 (exclusive)"

An explicitly specified range -

C# .NET System.Random.Next(minValue, maxValue)NET's System.Random.Next(minValue, maxValue): "maxValuemaxValue: The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue

Why do languages' random number generators tend to return a value exclusive of the upper bound of the range?

For example, an implicit range -

JavaScript's random() method "Return a random number between 0 (inclusive) and 1 (exclusive)"

An explicitly specified range -

C# .NET System.Random.Next(minValue, maxValue): "maxValue: The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue

Why do languages' random number generators tend to return a value exclusive of the upper bound of the range?

For example, an implicit range -

JavaScript's random() method "Return a random number between 0 (inclusive) and 1 (exclusive)"

An explicitly specified range -

.NET's System.Random.Next(minValue, maxValue): maxValue: The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue

1
source | link

Exclusive upper bound in random number range

Why do languages' random number generators tend to return a value exclusive of the upper bound of the range?

For example, an implicit range -

JavaScript's random() method "Return a random number between 0 (inclusive) and 1 (exclusive)"

An explicitly specified range -

C# .NET System.Random.Next(minValue, maxValue): "maxValue: The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue