/** {@inheritDoc} * @since 3.2 */ public Decimal64 copySign(final double sign) { return new Decimal64(FastMath.copySign(value, sign)); }
/** {@inheritDoc} * @since 3.2 */ public Decimal64 copySign(final Decimal64 sign) { return new Decimal64(FastMath.copySign(value, sign.value)); }
return leftPlane ? copySign(Math.PI, xa) : xa;
/** Get the projection. * @return projection */ public BoundaryProjection<S> getProjection() { // fix offset sign offset = FastMath.copySign(offset, (Boolean) leaf.getAttribute() ? -1 : +1); return new BoundaryProjection<S>(original, projected, offset); }
/** * Rounds the given value to the specified number of decimal places. * The value is rounded using the given method which is any method defined * in {@link BigDecimal}. * * @param x Value to round. * @param scale Number of digits to the right of the decimal point. * @param roundingMethod Rounding method as defined in {@link BigDecimal}. * @return the rounded value. * @since 1.1 (previously in {@code MathUtils}, moved as of version 3.0) * @throws MathArithmeticException if an exact operation is required but result is not exact * @throws MathIllegalArgumentException if {@code roundingMethod} is not a valid rounding method. */ public static float round(float x, int scale, int roundingMethod) throws MathArithmeticException, MathIllegalArgumentException { final float sign = FastMath.copySign(1f, x); final float factor = (float) FastMath.pow(10.0f, scale) * sign; return (float) roundUnscaled(x * factor, sign, roundingMethod) / factor; }
return new Split(FastMath.copySign(0.0, full), 0.0); } else if (full < 0 && (e & 0x1) == 1) { return Split.NEGATIVE_INFINITY;
} else { return createComplex(FastMath.abs(imaginary) / (2.0 * t), FastMath.copySign(1d, imaginary) * t);
/** {@inheritDoc} * @since 3.2 */ public Decimal64 copySign(final Decimal64 sign) { return new Decimal64(FastMath.copySign(value, sign.value)); }
/** {@inheritDoc} * @since 3.2 */ public Decimal64 copySign(final double sign) { return new Decimal64(FastMath.copySign(value, sign)); }
return leftPlane ? copySign(Math.PI, xa) : xa;
/** Get the projection. * @return projection */ public BoundaryProjection<S> getProjection() { // fix offset sign offset = FastMath.copySign(offset, (Boolean) leaf.getAttribute() ? -1 : +1); return new BoundaryProjection<S>(original, projected, offset); }
/** * Rounds the given value to the specified number of decimal places. * The value is rounded using the given method which is any method defined * in {@link BigDecimal}. * * @param x Value to round. * @param scale Number of digits to the right of the decimal point. * @param roundingMethod Rounding method as defined in {@link BigDecimal}. * @return the rounded value. * @since 1.1 (previously in {@code MathUtils}, moved as of version 3.0) * @throws MathArithmeticException if an exact operation is required but result is not exact * @throws MathIllegalArgumentException if {@code roundingMethod} is not a valid rounding method. */ public static float round(float x, int scale, int roundingMethod) throws MathArithmeticException, MathIllegalArgumentException { final float sign = FastMath.copySign(1f, x); final float factor = (float) FastMath.pow(10.0f, scale) * sign; return (float) roundUnscaled(x * factor, sign, roundingMethod) / factor; }
return new Split(FastMath.copySign(0.0, full), 0.0); } else if (full < 0 && (e & 0x1) == 1) { return Split.NEGATIVE_INFINITY;
} else { return createComplex(FastMath.abs(imaginary) / (2.0 * t), FastMath.copySign(1d, imaginary) * t);