valueOf() 공개 정적인 메소드

public static valueOf ( long arg0 ) : global::java.math.BigInteger
arg0 long
리턴 global::java.math.BigInteger
예제 #1
0
 /**
  * Calculates the subtraction (-) of this rational number and the specified argument.
  *
  * <p>This is functionally identical to
  * <code>this.subtract(BigRational.valueOf(value))</code>
  * but slightly faster.</p>
  *
  * <p>The result has no loss of precision.</p>
  *
  * @param value the int value to subtract
  * @return the resulting rational number
  */
 public BigRational subtract(int value)
 {
     if (value == 0)
     {
         return(this);
     }
     return(subtract(BigInteger.valueOf(value)));
 }
예제 #2
0
 /**
  * Calculates the addition (+) of this rational number and the specified argument.
  *
  * <p>This is functionally identical to
  * <code>this.add(BigRational.valueOf(value))</code>
  * but slightly faster.</p>
  *
  * <p>The result has no loss of precision.</p>
  *
  * @param value the int value to add
  * @return the resulting rational number
  */
 public BigRational add(int value)
 {
     if (value == 0)
     {
         return(this);
     }
     return(add(BigInteger.valueOf(value)));
 }
예제 #3
0
 /**
  * Calculates the division (/) of this rational number and the specified argument.
  *
  * <p>This is functionally identical to
  * <code>this.divide(BigRational.valueOf(value))</code>
  * but slightly faster.</p>
  *
  * <p>The result has no loss of precision.</p>
  *
  * @param value the int value to divide (0 is not allowed)
  * @return the resulting rational number
  * @throws ArithmeticException if the argument is 0 (division by zero)
  */
 public BigRational divide(int value)
 {
     return(divide(BigInteger.valueOf(value)));
 }
예제 #4
0
 /**
  * Calculates the multiplication (*) of this rational number and the specified argument.
  *
  * <p>This is functionally identical to
  * <code>this.multiply(BigRational.valueOf(value))</code>
  * but slightly faster.</p>
  *
  * <p>The result has no loss of precision.</p>
  *
  * @param value the int value to multiply
  * @return the resulting rational number
  */
 public BigRational multiply(int value)
 {
     return(multiply(BigInteger.valueOf(value)));
 }