F # has a shortcut for creating an array of numbers. For example, code
[1..10]
will create an array containing {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
or
[-2..2]
will create {-2, -1, 0, 1, 2}.
Is there a related transcript for creating an array in F # in floating point increments? For example, an array such as {-2.0, -1.5, -1.0, -0.5, 0, 0.5, 1.0, 1.5, 2}, where the step is 0.5? Or uses a loop foror the whileonly way?
source
share