Java Number Add add(long v1, long v2)

Here you can find the source of add(long v1, long v2)

Description

add

License

Open Source License

Parameter

Parameter Description
v1 a parameter
v2 a parameter

Declaration

public static long add(long v1, long v2) 

Method Source Code

//package com.java2s;
/**//  w  ww  . j a va2s . c o m
 * (C) 2011-2012 Alibaba Group Holding Limited.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 * 
 */

import java.math.BigDecimal;

public class Main {
    /**
     * @param v1
     * @param v2
     * @return
     */
    public static long add(long v1, long v2) {
        BigDecimal b1 = new BigDecimal(v1);
        BigDecimal b2 = new BigDecimal(v2);
        return b1.add(b2).longValue();
    }
}

Related

  1. add(double... ds)
  2. add(final Number a, final Number b)
  3. add(final String start, final String... values)
  4. add(float... values)
  5. add(float[] param)
  6. add(long val, long augend)
  7. add(Number a, Number b)
  8. add(Object addend, Object augend)
  9. add(Object num1, Object num2)