提供精确的减法运算

@param v1 被减数
@param v2 减数
@return 差
493394
public static double sub(float v1, float v2) {
		return sub(Float.toString(v1), Float.toString(v2)).doubleValue();
	}
460720
public static double sub(Double v1, Double v2) {
		return sub((Number) v1, (Number) v2).doubleValue();
	}
1144119
function(v1, v2)
{
   var rval = 0;
   
   if(v1.constructor === Array && v2.constructor === Array)
   {
      for(var i = 0; i < v1.length && rval === 0; ++i)
      {
         rval = _compare(v1[i], v2[i]);
      }
   }
   else
   {
      rval = (v1 < v2 ? -1 : (v1 > v2 ? 1 : 0));
   }
   
   return rval;
}
214784
public static double[] timesMinusTimesEquals(final double[] v1, final double s1, final double[] v2, final double s2) {
    assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
    for(int i = 0; i < v1.length; i++) {
      v1[i] = v1[i] * s1 - v2[i] * s2;
    }
    return v1;
  }
1349226
public static int compareVersions(String v1, String v2) {
		String s1 = normalisedVersion(v1);
		String s2 = normalisedVersion(v2);
		return s1 != null ? (s2 != null ? s1.compareTo(s2) : 1)
				: (s2 != null ? -1 : 0);
	}
392004
public static double cosAngle(NumberVector v1, NumberVector v2) {
    // Java Hotspot appears to optimize these better than if-then-else:
    return v1 instanceof SparseNumberVector ? //
        v2 instanceof SparseNumberVector ? //
            angleSparse((SparseNumberVector) v1, (SparseNumberVector) v2) : //
            angleSparseDense((SparseNumberVector) v1, v2) : //
        v2 instanceof SparseNumberVector ? //
            angleSparseDense((SparseNumberVector) v2, v1) : //
            angleDense(v1, v2);
  }
65269
public static double[] rotate90Equals(final double[] v1) {
    assert v1.length == 2 : "rotate90Equals is only valid for 2d vectors.";
    final double temp = v1[0];
    v1[0] = v1[1];
    v1[1] = -temp;
    return v1;
  }
1090197
public static double[] timesMinus(final double[] v1, final double s1, final double[] v2) {
    assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
    final double[] sub = new double[v1.length];
    for(int i = 0; i < v1.length; i++) {
      sub[i] = v1[i] * s1 - v2[i];
    }
    return sub;
  }
978711
def convert_v1_to_v2(
        dict  # type: Dict[str, Any]
    ):
    # type: (...) -> Dict[str, Any]
    
    version = dict['version']
    if version != 1:
        raise ValueError('Version {} not 1'.format(version))

    clk_config = dict['clkConfig']
    k = clk_config['k']
    clk_hash = clk_config['hash']

    def convert_feature(f):
        if 'ignored' in f:
            return f

        hashing = f['hashing']
        weight = hashing.get('weight', 1.0)

        if weight == 0:
            return {
                'identifier': f['identifier'],
                'ignored': True
            }

        x = deepcopy(f)
        hashing = x['hashing']
        if 'weight' in hashing:
            del hashing['weight']

        hashing['k'] = int(round(weight * k))
        hashing['hash'] = clk_hash
        return x

    result = {
        'version': 2,
        'clkConfig': {
            'l': clk_config['l'],
            'xor_folds': clk_config.get('xor_folds', 0),
            'kdf': clk_config['kdf']
        },
        'features': list(map(convert_feature, dict['features']))
    }
    return result
901932
public static double[] minusTimes(final double[] v1, final double[] v2, final double s2) {
    assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
    final double[] sub = new double[v1.length];
    for(int i = 0; i < v1.length; i++) {
      sub[i] = v1[i] - v2[i] * s2;
    }
    return sub;
  }
481233
public static double[] plusEquals(final double[] v1, final double[] v2) {
    assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
    for(int i = 0; i < v1.length; i++) {
      v1[i] += v2[i];
    }
    return v1;
  }
435768
public static double[] minus(final double[] v1, final double s1) {
    final double[] result = new double[v1.length];
    for(int i = 0; i < v1.length; i++) {
      result[i] = v1[i] - s1;
    }
    return result;
  }
774263
public static boolean sameMembersOrdered(View v1, View v2) {
        return Arrays.equals(v1.getMembersRaw(), v2.getMembersRaw());
    }
111101
private static BigDecimal doAdd(final BigDecimal v1, final BigDecimal v2) {
        BigDecimal total = v1;
        if (v1 != null && v2 != null) {
            total = v1.add(v2);
        } else if (v2 != null) {
            total = v2;
        }
        return total;
    }
421083
public static double method2(ICountFingerprint fp1, ICountFingerprint fp2) {

        long maxSum = 0, minSum = 0;
        int i = 0, j = 0;
        while (i < fp1.numOfPopulatedbins() || j < fp2.numOfPopulatedbins()) {
            Integer hash1 = i < fp1.numOfPopulatedbins() ? fp1.getHash(i) : null;
            Integer hash2 = j < fp2.numOfPopulatedbins() ? fp2.getHash(j) : null;
            Integer count1 = i < fp1.numOfPopulatedbins() ? fp1.getCount(i) : null;
            Integer count2 = j < fp2.numOfPopulatedbins() ? fp2.getCount(j) : null;

            if (count2 == null || (hash1 != null && hash1 < hash2)) {
                maxSum += count1;
                i++;
                continue;
            }
            if (count1 == null || (hash2 != null && hash1 > hash2)) {
                maxSum += count2;
                j++;
                continue;
            }

            if (hash1.equals(hash2)) {
                maxSum += Math.max(count1, count2);
                minSum += Math.min(count1, count2);
                i++;
                j++;
            }
        }
        return ((double) minSum) / maxSum;
    }
351591
public static boolean equal(Vector3f v1, Vector3f v2) {
        return equal(v1.x, v2.x) && equal(v1.y, v2.y) && equal(v1.z, v2.z);
    }
695278
public static double squareSum(final double[] v1) {
    double acc = 0.0;
    for(int row = 0; row < v1.length; row++) {
      final double v = v1[row];
      acc += v * v;
    }
    return acc;
  }