Sum of squares: Difference between revisions

m
(add RPL)
Line 2,495:
 
=={{header|RPL}}==
There is no such thing as zeroZero-length vectors don't exist in RPL, so thisthere's caseno doesneed notto havetackle tothis be tackledcase:
≪ 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>
{ } <span style="color:blue">∑SQL<span>
{{out}}
<pre>
1,150

edits