Re: Better median function?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Correction of my last mail, Nr.: 2  (it's to early)

 function mg(sequence s) -- geometric mean
     atom p              -- only for s[i]>0!!
     intrger l
     l = length(s)
     if l then
         p = 1                  -- !!!
         for i = 1 to l         -- !!!
             if s[i] > 0 then
                 p *= power(s[i],l)
             else
                 return {}
             end if
         end for
         return p
     else
     return s
     end if
 end function

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu