Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

sum: return the summatory reduction of all array items

Code Block
set total [objarray sum <obj>]

Return a single value with the summatory reduction of all array items

e.g.

Code Block
set obj [objarray new doublearray -values {3.5 2.1 0.3 3.5 2.6 0.3}]
-> 3.5 2.1 0.3 3.5 2.6 0.3
objarray sum $obj
-> 12.299999999999999