Mojo function
randint
randint[dtype: DType](ptr: UnsafePointer[SIMD[dtype, 1]], size: Int, low: Int, high: Int)
Fills memory with uniform random in range [low, high].
Constraints:
The type should be integral.
Parameters:
- dtype (
DType
): The dtype of the pointer.
Args:
- ptr (
UnsafePointer[SIMD[dtype, 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.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!