double Rectify(double iNum) { if (iNum < 0) { iNum = 0; } else if (iNum > 1.0) { iNum = 1.0; } return iNum; }