Skip to main content

function

randint

randint[type: DType](ptr: DTypePointer[type, 0], size: Int, low: Int, high: Int)

Fills memory with uniform random in range [low, high].

Constraints:

The type should be integral.

Parameters:

  • type (DType): The dtype of the pointer.

Args:

  • ptr (DTypePointer[type, 0]): The pointer to the memory area to fill.
  • size (Int): The number of elements to fill.
  • low (Int): The minimal value for random.
  • high (Int): The maximal value for random.