Handbook
Glossary
linspace[a..b] ( a b length -- seq )
Vocabulary
math
.
extras
Inputs
a
a
number
b
a
number
length
an
integer
Outputs
seq
a
sequence
Word description
Return evenly spaced numbers over an interval
[a,b]
.
Definition
USING:
arrays
combinators
kernel
math
math.extras.private
ranges
;
IN:
math.extras
:
linspace[a..b]
( a b length -- seq )
{
{
[
dup
1
<
]
[
3drop
{
}
]
}
{
[
dup
1
=
]
[
2drop
1array
]
}
[
1
-
steps
<range>
]
}
cond
;