各位大神,VFP怎么求数组的几何平均数啊?
各位大神,VFP怎么求数组的几何平均数啊? 我尝试用Excel的geomean 函数,结果不能用!请各位大神帮帮忙吧
TEXT TO jsCode TEXTMERGE NOSHOW PRETEXT 15 function pow(x,n){return Math.pow(x,1/n);}; ENDTEXT sc = CREATEOBJECT("ScriptControl") sc.Language = "JavaScript" sc.AddCode(jsCode) js = sc.CodeObject SELECT VAL(zbdm) FROM 举例 INTO ARRAY arr n = ALEN(arr) m = 1 FOR EACH dm IN arr m = m * js.pow(dm,n) ENDFOR ? m