Sum of squares: Difference between revisions
m
→{{header|RPL}}: typo
(add RPL) |
m (→{{header|RPL}}: typo) |
||
Line 2,495:
=={{header|RPL}}==
≪ DUP DOT ≫ '<span style="color:blue">∑SQV</span>' STO
If we really need zero-length objects, we can use lists:
≪ 0 SWAP
'''IF''' DUP SIZE '''THEN'''
1 OVER SIZE '''FOR''' j
DUP j GET SQ + '''NEXT'''
'''END''' DROP
Line 2,510:
{ 1 2 3 4 5 } <span style="color:blue">∑SQL</span>
{ } <span style="color:blue">∑SQL</span>
{{out}}
<pre>
|