klyn.math.NDArray.randint
method
public static randint(min as Int, max as Int, notnull shape as IList<UInt>) as NDArray<T>
Description

Creates a new NDArray with random integers.

Parameters
ParameterDescription
minThe minimum value (inclusive).
maxThe maximum value (inclusive).
shapeThe shape of the array.
Returns

A new NDArray with random integers.

Throws
  • NullException if shape is null at runtime; statically null arguments are rejected with TypeError.
Example
a = NDArray<Int>.randint(10, 20, [2ul, 3ul])
print(a)  # Example: [[13, 18, 10], [20, 11, 16]]