code: public static double precision(long tpCount, long fpCount, double edgeCase) {
          //Edge case
          if (tpCount == 0 && fpCount == 0) {
              return edgeCase;
          }
  
          return tpCount / (double) (tpCount + fpCount);
      }
docs: Calculate the precision from true positive and false positive counts
  
  @param tpCount  True positive count
  @param fpCount  False positive count
  @param edgeCase Edge case value use to avoid 0/0
  @return Precision