arange<T extends SizedNativeType> function
arange(start, stop, step, dtype=None)
Return evenly spaced values within a given interval.
Parameters
start : integer or real, optional
Start of interval. The interval includes this value. The default
start value is 0.
stop : integer or real
End of interval. The interval does not include this value,
except in some cases where step is not an integer and
floating point round-off affects the length of out.
step : integer or real, optional
Spacing between values. For any output out, this is the
distance between two adjacent values, out[i+1] - out[i].
The default step size is 1. If step is specified as a
position argument, start must also be given.
dtype : dtype
The type of the output array. If dtype is not given, infer the
data type from the other input arguments.
Returns
arange : var Var of evenly spaced values.
Examples
np.arange(0, 5, 1) var(
0, 1, 2, 3, 4) np.arange(5.) var(0., 1., 2., 3., 4.)
Implementation
VARP arange<T extends ffi.SizedNativeType>({required num stop, num? start, num? step}) {
final x = F.range(F.scalar<T>(start ?? 0), F.scalar<T>(stop), F.scalar<T>(step ?? 1));
return F.cast<T>(x);
}