Exemplo n.º 1
0
 // Calculate a new candidate value for this quantity as
 // an average of its expressions. Perform all calculations
 // using the log to limit propagation of truncation errors.
 public void CalcCandidate()
 {
     if (!_isExact && _expressionList.Count > 0)
     {
         _candidate.Log = _expressionList.AverageLog();
         // keep the calculated value within the fences
         if (_uncertainty.Value != 0)
         {
             if (_candidate.Log < _lowfence.Log)
             {
                 _candidate.Log = _lowfence.Log;
             }
             else if (_candidate.Log > _highfence.Log)
             {
                 _candidate.Log = _highfence.Log;
             }
         }
     }
     else
     {
         _candidate = new CNumber(_number);
     }
 }