Exact subtraction of large numbers

From , 3 Years ago, written in Java, viewed 183 times.
URL https://pastebin.vip/view/069d3bb0
  1.         /**
  2.          * 提供精确的减法运算。
  3.          * @param v1 被减数
  4.          * @param v2 减数
  5.          * @return 两个参数的差
  6.          */
  7.         public static double sub(double v1, double v2) {
  8.                 BigDecimal b1 = new BigDecimal(Double.toString(v1));
  9.                 BigDecimal b2 = new BigDecimal(Double.toString(v2));
  10.                 return (b1.subtract(b2)).doubleValue();
  11.         }

Reply to "Exact subtraction of large numbers"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website