比较大小，参数1 &gt; 参数2 返回true

@param bigNum1 数字1
@param bigNum2 数字2
@return 是否大于
@since 3,0.9
965865
public static boolean isGreater(BigDecimal bigNum1, BigDecimal bigNum2) {
		Assert.notNull(bigNum1);
		Assert.notNull(bigNum2);
		return bigNum1.compareTo(bigNum2) > 0;
	}
757725
public static int compareBytes(byte[] b1, int s1, int l1,
                                   byte[] b2, int s2, int l2) {
        return FastByteComparisons.compareTo(b1, s1, l1, b2, s2, l2);
    }
1123537
@Override
    protected double scoreImpl(List<Word> words1, List<Word> words2) {
        if(words1.isEmpty() && words2.isEmpty()){
            return 1.0;
        }
        //转变为不重复的集合
        Set<Word> words1Set = new HashSet<>(words1);
        Set<Word> words2Set = new HashSet<>(words2);
        // 两个集合的大小
        int set1Size = words1Set.size();
        int set2Size = words2Set.size();

        // 求交集（去重），计算交集的不重复词的个数
        words1Set.retainAll(words2Set);
        int intersectionSize = words1Set.size();

        //相似度分值
        double score = 2*intersectionSize / (double)(set1Size+set2Size);
        if(LOGGER.isDebugEnabled()) {
            LOGGER.debug("集合1：" + words1);
            LOGGER.debug("集合2：" + words2);
            LOGGER.debug("集合1的大小：" + set1Size);
            LOGGER.debug("集合2的大小：" + set2Size);
            LOGGER.debug("交集的大小：" + intersectionSize);
            LOGGER.debug("相似度分值=2*" + intersectionSize + "/(double)(" + set1Size + "+" + set2Size + ")=" + score);
        }
        return score;
    }
1205866
private function bigMul($num1, $num2)
    {
        if ($num1 < 10 || $num2 < 10) {
            return $num1 * $num2;
        }

        $m = max([$this->getBit($num1), $this->getBit($num2)]);
        $m2 = floor($m / 2);

        $high1 = $this->getHighBitPart($num1, $m2);
        $low1 = $this->getLowBitPart($num1, $m2);

        $high2 = $this->getHighBitPart($num2, $m2);
        $low2 = $this->getLowBitPart($num2, $m2);

        $z2 = $this->bigMul($high1, $high2);
        $z0 = $this->bigMul($low1, $low2);
        $z1 = $this->bigMul(($high1 + $low1), ($high2 + $low2)) - $z2 - $z0;
        return $z2 * pow(10, 2 * $m2) + $z1 * pow(10, $m2) + $z0;
    }
296790
public char match(String str1, String str2) {
        if (null == str1 || null == str2 || 0 == str1.length() || 0 == str2.length()) {
            return IMappingElement.IDK;
        }
        float sim = 1 - (float) getLevenshteinDistance(str1, str2) / java.lang.Math.max(str1.length(), str2.length());
        if (threshold <= sim) {
            return IMappingElement.EQUIVALENCE;
        } else {
            return IMappingElement.IDK;
        }
    }
704056
@Override
    public int compare(HashMap m1, HashMap m2) {
        double val1;
        double val2;
        for (String sortId : sortIds) {
            val1 = getValue(m1, sortId);
            val2 = getValue(m2, sortId);
            if (val1 > val2) {
                return decVal;
            } else if (val1 < val2) {
                return ascVal;
            }
        }
        return 0;
    }
560194
public static double divide(final double n1, final double n2) {
		final BigDecimal b1 = new BigDecimal(n1);
		final BigDecimal b2 = new BigDecimal(n2 + "");
		BigDecimal b3 = b1.divide(b2, 3, BigDecimal.ROUND_HALF_UP);
		b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP);
		final double result = b3.doubleValue();
		return result;
	}
874776
def num_matching(one_bigrams, two_bigrams, acc = 0)
      return acc if one_bigrams.empty? || two_bigrams.empty?

      one_two = one_bigrams.index(two_bigrams[0])
      two_one = two_bigrams.index(one_bigrams[0])

      if one_two.nil? && two_one.nil?
        num_matching(one_bigrams.drop(1), two_bigrams.drop(1), acc)
      else
        # If one is nil, it is set to the other
        two_one ||= one_two
        one_two ||= two_one

        if one_two < two_one
          num_matching(one_bigrams.drop(one_two + 1),
                       two_bigrams.drop(1), acc + 1)
        else
          num_matching(one_bigrams.drop(1),
                       two_bigrams.drop(two_one + 1), acc + 1)
        end
      end
    end
1280764
function BigNumber(v, b) {
      var alphabet, c, caseChanged, e, i, isNum, len, str,
        x = this;

      // Enable constructor call without `new`.
      if (!(x instanceof BigNumber)) return new BigNumber(v, b);

      if (b == null) {

        if (v && v._isBigNumber === true) {
          x.s = v.s;

          if (!v.c || v.e > MAX_EXP) {
            x.c = x.e = null;
          } else if (v.e < MIN_EXP) {
            x.c = [x.e = 0];
          } else {
            x.e = v.e;
            x.c = v.c.slice();
          }

          return;
        }

        if ((isNum = typeof v == 'number') && v * 0 == 0) {

          // Use `1 / n` to handle minus zero also.
          x.s = 1 / v < 0 ? (v = -v, -1) : 1;

          // Fast path for integers, where n < 2147483648 (2**31).
          if (v === ~~v) {
            for (e = 0, i = v; i >= 10; i /= 10, e++);

            if (e > MAX_EXP) {
              x.c = x.e = null;
            } else {
              x.e = e;
              x.c = [v];
            }

            return;
          }

          str = String(v);
        } else {

          if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);

          x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
        }

        // Decimal point?
        if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');

        // Exponential form?
        if ((i = str.search(/e/i)) > 0) {

          // Determine exponent.
          if (e < 0) e = i;
          e += +str.slice(i + 1);
          str = str.substring(0, i);
        } else if (e < 0) {

          // Integer.
          e = str.length;
        }

      } else {

        // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'
        intCheck(b, 2, ALPHABET.length, 'Base');

        // Allow exponential notation to be used with base 10 argument, while
        // also rounding to DECIMAL_PLACES as with other bases.
        if (b == 10) {
          x = new BigNumber(v);
          return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
        }

        str = String(v);

        if (isNum = typeof v == 'number') {

          // Avoid potential interpretation of Infinity and NaN as base 44+ values.
          if (v * 0 != 0) return parseNumeric(x, str, isNum, b);

          x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;

          // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'
          if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) {
            throw Error
             (tooManyDigits + v);
          }
        } else {
          x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
        }

        alphabet = ALPHABET.slice(0, b);
        e = i = 0;

        // Check that str is a valid base b number.
        // Don't use RegExp, so alphabet can contain special characters.
        for (len = str.length; i < len; i++) {
          if (alphabet.indexOf(c = str.charAt(i)) < 0) {
            if (c == '.') {

              // If '.' is not the first character and it has not be found before.
              if (i > e) {
                e = len;
                continue;
              }
            } else if (!caseChanged) {

              // Allow e.g. hexadecimal 'FF' as well as 'ff'.
              if (str == str.toUpperCase() && (str = str.toLowerCase()) ||
                  str == str.toLowerCase() && (str = str.toUpperCase())) {
                caseChanged = true;
                i = -1;
                e = 0;
                continue;
              }
            }

            return parseNumeric(x, String(v), isNum, b);
          }
        }

        // Prevent later check for length on converted number.
        isNum = false;
        str = convertBase(str, b, 10, x.s);

        // Decimal point?
        if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');
        else e = str.length;
      }

      // Determine leading zeros.
      for (i = 0; str.charCodeAt(i) === 48; i++);

      // Determine trailing zeros.
      for (len = str.length; str.charCodeAt(--len) === 48;);

      if (str = str.slice(i, ++len)) {
        len -= i;

        // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'
        if (isNum && BigNumber.DEBUG &&
          len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
            throw Error
             (tooManyDigits + (x.s * v));
        }

         // Overflow?
        if ((e = e - i - 1) > MAX_EXP) {

          // Infinity.
          x.c = x.e = null;

        // Underflow?
        } else if (e < MIN_EXP) {

          // Zero.
          x.c = [x.e = 0];
        } else {
          x.e = e;
          x.c = [];

          // Transform base

          // e is the base 10 exponent.
          // i is where to slice str to get the first element of the coefficient array.
          i = (e + 1) % LOG_BASE;
          if (e < 0) i += LOG_BASE;  // i < 1

          if (i < len) {
            if (i) x.c.push(+str.slice(0, i));

            for (len -= LOG_BASE; i < len;) {
              x.c.push(+str.slice(i, i += LOG_BASE));
            }

            i = LOG_BASE - (str = str.slice(i)).length;
          } else {
            i -= len;
          }

          for (; i--; str += '0');
          x.c.push(+str);
        }
      } else {

        // Zero.
        x.c = [x.e = 0];
      }
    }
1267923
public static double addAmounts(final double num1, final double num2) {
		final BigDecimal b1 = new BigDecimal(num1);
		final BigDecimal b2 = new BigDecimal(num2);
		BigDecimal b3 = b1.add(b2);
		b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP);
		final double result = b3.doubleValue();
		return result;
	}
651918
public static function compare($n1, $n2)
    {
        $n1 = self::round($n1, 2);
        $n2 = self::round($n2, 2);

        return (bccomp($n1, $n2, self::$scale) === 0);
    }
582600
@Override
    public double similarScore(String text1, String text2) {
        if(LOGGER.isDebugEnabled()) {
            LOGGER.debug("文本1：");
            LOGGER.debug("\t" + text1);
            LOGGER.debug("文本2：");
            LOGGER.debug("\t" + text2);
        }
        if(text1 == null || text2 == null){
            //只要有一个文本为null，规定相似度分值为0，表示完全不相等
            return 0.0;
        }
        //分词
        List<Word> words1 = seg(text1);
        List<Word> words2 = seg(text2);
        //计算相似度分值
        return similarScore(words1, words2);
    }
1357991
public static double mutiply(final double n1, final double n2) {
		final BigDecimal b1 = new BigDecimal(n1);
		final BigDecimal b2 = new BigDecimal(n2);
		BigDecimal b3 = b1.multiply(b2);
		b3 = b3.setScale(3, BigDecimal.ROUND_HALF_UP);
		final double result = b3.doubleValue();
		return result;
	}
498039
public static BigDecimal sub(Number v1, Number v2) {
		return sub(new Number[] { v1, v2 });
	}
1176394
@Pure
	@Inline(value = "MathUtil.isEpsilonEqual($1, $2, Double.NaN)", imported = {MathUtil.class})
	public static boolean isEpsilonEqual(double v1, double v2) {
		return isEpsilonEqual(v1, v2, Double.NaN);
	}
1298188
public static int compare( String s1, String s2)
	{
		if (s1 == null && s2 == null)
		{
			return 0;
		}
		else if (s1 == null && s2 != null)
		{
			return -1;
		}
		else if (s1 != null && s2 == null)
		{
			return 1;
		}
		else
		{
			return s1.compareTo(s2);
		}
	}
744143
public static BigDecimal div(Number v1, Number v2) {
		return div(v1, v2, DEFAUT_DIV_SCALE);
	}