public BigRational(int value) : this(BigDecimal.valueOf(value), BigDecimal.ONE) { }
/** * 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))); }
public static BigComplex valueOfPolar(double radius, double angle, MathContext mathContext) { return(valueOfPolar(BigDecimal.valueOf(radius), BigDecimal.valueOf(angle), mathContext)); }
/** * 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))); }
/** * 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))); }
/** * 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)); }
/** * 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)); }
/** * 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))); }
/** * 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))); }