View/Edit #3456:add

Switch to edit mode.

Name(s): add
1:  ":add({ax, ay, az, ...}, {bx, by, bz, ...}, {cx, cy, cz, ...}, ...) => {ax+bx+cx+..., ay+by+cy+..., az+bz+cz+..., ...}"
2:  if (!args)
3:    return E_NONE
4:  endif
5:  sum = args[1]
6:  for x in (listdelete(args, 1))
7:    length(sum) == length(x) || raise(E_INVARG, "All vectors must be have an equal number of dimensions!")
8:    for y in [1..length(x)]
9:      sum[y] = sum[y] + x[y]
10:   endfor
11: endfor
12: return sum
13: "Last modified by manta (#7165) on Thu Feb 26 22:21:49 1998 EST."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Hacker (#60)

You are not logged in.

[home | help | who | search | setup | code]