Template:Arsum

From Tales of Maj'Eyal
Revision as of 00:54, 12 February 2016 by Ibanix (Talk | contribs) (should be done)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Simple arithmetic sum function.

Use:{{arsum|<start>|<end>|<count>}}

Eg: {{arsum|0.5|5|10}} returns 27.5

Description

  • start - min value
  • count - number of steps
  • end - max value

eg: Sum (x/2) from 1->10

  • Start = 1/2 = 0.5
  • Count = 10
  • End = 10/2 = 5

Correct formula is: (0.5*count*(start+end))

For above example:

(0.5*10*(1/2+10/2)) = 5*(11/2) = 27.5