Compute the covered percentage.

@param cover the cover array.
@return coverage percentage.
495584
public static double computeCover(boolean[] cover) {
    int covered = 0;
    for (boolean i : cover) {
      if (i) {
        covered++;
      }
    }
    return (double) covered / (double) cover.length;
  }
697384
private int getPercentageY(double value) {
		value = 1.0 - value;
		double d = top + (((bottom - top) * value) / (maxPercentage - minPercentage));
		return (int) d;
	}
442822
def total_coverage
      return 0.0 if lines.size.zero?
      ran_lines.size.to_f / lines.size.to_f
    end
718276
public double getCacheHitRatio() {
		return this.cacheHits.get()+this.cacheMiss.get() == 0 ? 0 : this.cacheHits.get() / (1.0*this.cacheHits.get()+this.cacheMiss.get());
	}
309177
def get_percent(self):
        """"""
        if not (self.votes and self.score):
            return 0
        return 100 * (self.get_rating() / self.field.range)
143973
@Monitor(name = "ResponseTimeMillis50Percentile", type = DataSourceType.INFORMATIONAL,
             description = "50th percentile in total time to handle a request, in milliseconds")
    public double getResponseTime50thPercentile() {
        return getResponseTimePercentile(Percent.FIFTY);
    }
856046
private int percent(final long val, final long total) {
        if (total == 0) {
            return 100;
        }

        if (val == 0) {
            return 0;
        }

        double dVal = (double) val;
        double dTotal = (double) total;

        return (int) (dVal / dTotal * 100);
    }
1163150
public function getCoverageRate(): float
    {
        $coveredRate = 0;
        $coveredByTestsTotal = $this->totalMutantsCount - $this->notCoveredByTestsCount;

        if ($this->totalMutantsCount) {
            $coveredRate = floor(100 * $coveredByTestsTotal / $this->totalMutantsCount);
        }

        return $coveredRate;
    }
956410
public double getAverage() {
        readLock.lock();
        try {
            // any values at all, needed to avoid a DivideByZero exception
            if (this.values.size() <= 0) {
                return 0;
            }
            return ((double)this.total / (double)this.values.size());
        } finally {
            readLock.unlock();
        }
    }
350282
public static Range<Double> calcCI95(Double percentageValue, Integer sampleSize) {
//        GWT.log("calcCI95", null);
        GWT.log("percentageValue: " + percentageValue.toString(), null);
        GWT.log("sampleSize: " + sampleSize, null);
        if (sampleSize==0) {
            return null;
        }
        if ( (sampleSize < 0) ||(percentageValue < 0.0) || (percentageValue > 100.0) ) {
            throw new IllegalArgumentException("sampleSize < 0, percentageValue < 0.0, or percentageValue > 100.0");
        }

        //convert percentageValue to ratio
        Double ratio = percentageValue/100.0;
        Double oneMinusRatio = 1.0 - ratio;

        Double sqrtSD = Math.sqrt(zStdDevSqrd + (4*sampleSize*ratio*oneMinusRatio));
        Double denom = 2*(sampleSize + zStdDevSqrd);

        Double lowerLimit = ((2*sampleSize*ratio) + zStdDevSqrd - (zStdDev *sqrtSD))/denom;

        Double upperLimit = ((2*sampleSize*ratio) + zStdDevSqrd + (zStdDev *sqrtSD))/denom;

        //convert back to percentages, to 1 d.p.
        lowerLimit = Math.rint(lowerLimit*1000)/10.0;
        upperLimit = Math.rint(upperLimit*1000)/10.0;

        if(lowerLimit<0.0) {
            lowerLimit = 0.0;
        }
        if(upperLimit>100.0) {
            upperLimit = 100.0;
        }

//        GWT.log("lowerLimit: " + lowerLimit.toString(), null);
//        GWT.log("upperLimit: " + upperLimit.toString(), null);
        return new Range<Double>(lowerLimit, upperLimit);
    }
318850
function (percent) {
            var min = this.options.min,
                max = this.options.max,
                min_decimals = min.toString().split(".")[1],
                max_decimals = max.toString().split(".")[1],
                min_length, max_length,
                avg_decimals = 0,
                abs = 0;

            if (percent === 0) {
                return this.options.min;
            }
            if (percent === 100) {
                return this.options.max;
            }


            if (min_decimals) {
                min_length = min_decimals.length;
                avg_decimals = min_length;
            }
            if (max_decimals) {
                max_length = max_decimals.length;
                avg_decimals = max_length;
            }
            if (min_length && max_length) {
                avg_decimals = (min_length >= max_length) ? min_length : max_length;
            }

            if (min < 0) {
                abs = Math.abs(min);
                min = +(min + abs).toFixed(avg_decimals);
                max = +(max + abs).toFixed(avg_decimals);
            }

            var number = ((max - min) / 100 * percent) + min,
                string = this.options.step.toString().split(".")[1],
                result;

            if (string) {
                number = +number.toFixed(string.length);
            } else {
                number = number / this.options.step;
                number = number * this.options.step;

                number = +number.toFixed(0);
            }

            if (abs) {
                number -= abs;
            }

            if (string) {
                result = +number.toFixed(string.length);
            } else {
                result = this.toFixed(number);
            }

            if (result < this.options.min) {
                result = this.options.min;
            } else if (result > this.options.max) {
                result = this.options.max;
            }

            return result;
        }
931501
public double getColorPercentage(Color color)
    {
        if (color == null)
            return 0;
        else
        {
            Integer num = colors.get(colorKey(color));
            if (num == null) num = 0;
            if (totalLength == 0)
                return 0;
            else
                return (double) num / totalLength;
        }
    }
229589
public double computeFirstCover(boolean leaf) {
    double max = 0.;
    for(DistanceEntry<E> e : firstAssignments) {
      double cover = leaf ? e.getDistance() : (e.getEntry().getCoveringRadius() + e.getDistance());
      max = cover > max ? cover : max;
    }
    return max;
  }
1353891
def _is_covered(self, global_state: GlobalState) -> bool:
        
        bytecode = global_state.environment.code.bytecode
        index = global_state.mstate.pc
        return self.instruction_coverage_plugin.is_instruction_covered(bytecode, index)
93534
public int getProgressPercentage()  {
        // Implemented using node counts...
        if (isRunning()) {
            int progress = (hProcess.getTestCurrentCount(plugin) * 100) / hProcess.getTestTotalCount();
            // Make sure not return 100 (or more) if still running...
            // That might happen if more nodes are being scanned that the ones enumerated at the beginning.
            return progress >= 100 ? 99 : progress;
        } else if (isCompleted() || isSkipped()) {
            return 100;        
            
        } else {
            return 0;
        }
    }
533869
private Double getPercentage(Number number)
   {
      Double result = null;

      if (number != null)
      {
         result = Double.valueOf(number.doubleValue() / 100);
      }

      return result;
   }
767844
protected double getKnobPercent() {
		// If we have no range
		if (maxValue <= minValue) {
			return 0;
		}

		// Calculate the relative progress
		double percent = (curValue - minValue) / (maxValue - minValue);
		return Math.max(0.0, Math.min(1.0, percent));
	}