AVG
Function calculates the average value of arguments according to one of four algorithms:
- the average arithmetic, 'a'
- the average geometric, 'g'
- the average harmonic, 'h'
- the average quadratic, 'q'
More see: http://en.wikipedia.org/wiki/Average
Function assumes upon entrance two and more than the parameters.
First argument of function - type of the used algorithm for calculating the average value. Valid values: 'a', 'g', 'h', 'q'.
Second and nexts arguments of function - values, for which it is nessesary to obtain the average.
Example function call:
<TMPL_var AVG('a', 1, 2, 3)>: 2
<TMPL_var AVG('g', 1, 2, 3)>: 1.81712059283
<TMPL_var AVG('h', 1, 2, 3)>: 1.63636363636
<TMPL_var AVG('q', 1, 2, 3)>: 2.16024689947
Copyright © 2003 - 2010 CTPP Dev. Team | http://ctpp.havoc.ru