P
PeterOut
float fMax=0, faArray[16], fValue;
int i;
for (i=0; i<16; ++i)
if ((faArray-fValue)>fMax) fMax=faArray-fValue;
OR
float fMax=0, faArray[16], fValue, fTemp;
int i;
for (i=0; i<16; ++i)
if ((fTemp=faArray-fValue)>fMax) fMax=fTemp;
In the former case I am doing a subtraction twice but only if the
condition is true. In the latter case, I am writing the difference
into a variable that may not be used, depending on the condition.
Many thanks in advance,
Peter.
int i;
for (i=0; i<16; ++i)
if ((faArray-fValue)>fMax) fMax=faArray-fValue;
OR
float fMax=0, faArray[16], fValue, fTemp;
int i;
for (i=0; i<16; ++i)
if ((fTemp=faArray-fValue)>fMax) fMax=fTemp;
In the former case I am doing a subtraction twice but only if the
condition is true. In the latter case, I am writing the difference
into a variable that may not be used, depending on the condition.
Many thanks in advance,
Peter.