valueOf() публичный статический Метод

public static valueOf ( double arg0 ) : global::java.math.BigDecimal
arg0 double
Результат global::java.math.BigDecimal
Пример #1
0
 public BigRational(int value) : this(BigDecimal.valueOf(value), BigDecimal.ONE)
 {
 }
Пример #2
0
 /**
  * Creates a rational number of the specified numerator/denominator int values.
  *
  * @param numerator the numerator int value
  * @param denominator the denominator int value (0 not allowed)
  * @return the rational number
  * @throws ArithmeticException if the denominator is 0 (division by zero)
  */
 public static BigRational valueOf(int numerator, int denominator)
 {
     return(of(BigDecimal.valueOf(numerator), BigDecimal.valueOf(denominator)));
 }
Пример #3
0
 public static BigComplex valueOfPolar(double radius, double angle, MathContext mathContext)
 {
     return(valueOfPolar(BigDecimal.valueOf(radius), BigDecimal.valueOf(angle), mathContext));
 }
Пример #4
0
 /**
  * Calculates the addition of the given real {@code double} value to this complex number.
  *
  * <p>This methods <strong>does not</strong> modify this instance.</p>
  *
  * @param value the real {@code double} value to add
  * @return the calculated {@link BigComplex} result
  */
 public BigComplex add(double value)
 {
     return(add(BigDecimal.valueOf(value)));
 }
Пример #5
0
 /**
  * Returns a complex number with the specified real and imaginary {@code double} parts.
  *
  * @param real the real {@code double} part
  * @param imaginary the imaginary {@code double} part
  * @return the complex number
  */
 public static BigComplex valueOf(double real, double imaginary)
 {
     return(valueOf(BigDecimal.valueOf(real), BigDecimal.valueOf(imaginary)));
 }
Пример #6
0
 /**
  * Returns a complex number with the specified real {@code double} part.
  *
  * @param real the real {@code double} part
  * @return the complex number
  */
 public static BigComplex valueOf(double real)
 {
     return(valueOf(BigDecimal.valueOf(real), BigDecimal.ZERO));
 }
Пример #7
0
 /**
  * Calculates this complex number divided by the given real {@code double} value using the specified {@link MathContext}.
  *
  * <p>This methods <strong>does not</strong> modify this instance.</p>
  *
  * @param value the {@code double} value to divide by
  * @param mathContext the {@link MathContext} used to calculate the result
  * @return the calculated {@link BigComplex} result
  */
 public BigComplex divide(double value, MathContext mathContext)
 {
     return(divide(BigDecimal.valueOf(value), mathContext));
 }
Пример #8
0
 /**
  * Calculates the multiplication of the given real {@code double} value with this complex number.
  *
  * <p>This methods <strong>does not</strong> modify this instance.</p>
  *
  * @param value the real {@code double} value to multiply
  * @return the calculated {@link BigComplex} result
  */
 public BigComplex multiply(double value)
 {
     return(multiply(BigDecimal.valueOf(value)));
 }
Пример #9
0
 /**
  * Calculates the subtraction of the given real {@code double} value from this complex number.
  *
  * <p>This methods <strong>does not</strong> modify this instance.</p>
  *
  * @param value the real {@code double} value to subtract
  * @return the calculated {@link BigComplex} result
  */
 public BigComplex subtract(double value)
 {
     return(subtract(BigDecimal.valueOf(value)));
 }