<div class="meta" robots="noindex">

</div>

Method

# Xojo.Math.RandomInt

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `Random</api/math/random>` as a replacement.

</div>

## Description

Returns a random integer in the given range (inclusive).

## Notes

Uses the mersenne twister engine (aka PRNG) with the seed set using std::random_device.

<div class="warning">

<div class="title">

Warning

</div>

An `InvalidArgumentException</api/exceptions/invalidargumentexception>` will be raised if min is greater than max.

</div>

## Sample code

``` xojo
Using Xojo.Math
Dim num As Int64 = RandomInt(10, 50)
```

## Compatibility

All project types on all supported operating systems.
