Handbook
Glossary
sum-of-cubes ( seq -- x )
Vocabulary
math
.
statistics
Inputs
seq
an
object
Outputs
x
an
object
See also
sum-of-squares
,
sum-of-quads
Definition
IN:
math.statistics
GENERIC:
sum-of-cubes
( seq -- x )
Methods
USING:
math
math.statistics
sequences
;
M:
iota
sum-of-cubes
sum
sq
;
USING:
kernel
math.functions
math.statistics
sequences
;
M:
object
sum-of-cubes
[
3
^
]
map-sum
;
USING:
accessors
combinators.short-circuit
generic
kernel
math
math.statistics
ranges
sequences
;
M:
range
sum-of-cubes
dup
{
[
step>>
1
=
]
[
from>>
integer?
]
}
1&&
[
[
from>>
]
[
length>>
]
bi
dupd
+
[
<iota>
sum-of-cubes
]
bi@
swap
-
]
[
M\
range
sum-of-cubes
(call-next-method)
]
if
;