xtd 0.2.0
Loading...
Searching...
No Matches

◆ next() [3/6]

virtual int32 xtd::random::next ( int32  max_value) const
virtual

Returns a nonnegative random number less than the specified maximum.

Parameters
max_valueThe exclusive upper bound of the random number to be generated. max_value must be greater than or equal to zero.
Returns
A 32-bit signed integer greater than or equal to zero and less than max_value
Exceptions
argument_out_of_range_exceptionmax_value is less than zero.
Remarks
The next(int32) overload returns random integers that range from 0 to max_value – 1. However, if max_value is 0, the method returns 0.