Skip to main content
Log in

Mojo function

randint

randint[type: DType](ptr: UnsafePointer[SIMD[type, 1]], 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 (UnsafePointer[SIMD[type, 1]]): 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.