Task

Write a program to find the sum of squares of a numeric vector.

The program should work on a zero-length vector (with an answer of   0).



Related task

   Mean


 
/sqrsum{
/x exch def
/sum 0 def
/i 0 def
x length 0 eq
{}
{
x length{
/sum sum x i get 2 exp add def
/i i 1 add def
}repeat
}ifelse
sum ==
}def
 