請教retval在函數裡的用法
例如:
if ...then retval = true else retval = false;
if ...then AAA(函數名) = true else AAA = false;
又例如:
VR.xs
VR = iff(DNV + NCV/2=0,VR[1],100 * (UPV + NCV/2)/(DNV + NCV/2));
ArrayLinearRegSlope.xs
retval = IFF((Length*SumX2 - Square(SumX)) <> 0,
(Length*SumXY - SumX*SumY) / (Length*SumX2 - Square(SumX)),
0);
以上舉的例子裡兩種寫法都可以嗎? 所得的結果是一樣的嗎?
1 評論