valueOf() public static method

public static valueOf ( long arg0 ) : global::java.math.BigInteger
arg0 long
return global::java.math.BigInteger
Exemplo n.º 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)));
 }
Exemplo n.º 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)));
 }
Exemplo n.º 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)));
 }
Exemplo n.º 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)));
 }