Beispiel #1
0
        public static double invert(InvertDelegate fn, double low, double high, double i)
        {
            double probe;

            while (high - low > 0.001)
            {
                probe = (low + high) / 2;
                if (fn(probe) > i)
                {
                    high = probe;
                }
                else
                {
                    low = probe;
                }
            }
            return(low);
        }
Beispiel #2
0
 public static double invert(InvertDelegate fn, double low, double high, double i)
 {
     double probe;
     while (high - low > 0.001)
     {
         probe = (low + high) / 2;
         if (fn(probe) > i)
             high = probe;
         else
             low = probe;
     }
     return low;
 }