@Override protected ExprEval eval(double x, double y) { return ExprEval.of(Math.copySign(x, y)); } }
/** * Approximation of erf 'Gauss error function' which is used to calculate * the cumulative distribution of a gaussian distribution. * This is used to simulate a large kernel gaussian blur without having * to sample the same chunk multiple times. */ private double erf(double x) { double ax = Math.abs(x); double t = 1.d / (1.d + (ax * .3275911d)); double y = 1.d - ((((((1.061405429d * t) - 1.453152027d) * t) + 1.421413741d) * t - 0.284496736d) * t + 0.254829592d) * t * Math.exp(-ax * ax); return Math.copySign(y, x); }
return Math.copySign(a - b, 1.0) <= tolerance
return Math.copySign(a - b, 1.0) <= tolerance
return Math.copySign(a - b, 1.0) <= tolerance
return Math.copySign(a - b, 1.0) <= tolerance
return x + copySign(0.5, x); } else { return z;
return x + copySign(0.5, x); } else { return z;
return x + copySign(0.5, x); } else { return z;
if (qValue > matchQ) { isBetter = true; } else if (Math.copySign(qValue - matchQ, 1.0f) <= 0.0001f) { if (matchNumWildcards > numWildcards) { isBetter = true;
return x + copySign(0.5, x); } else { return z;
final double txMax; final Vector3d xNormal; if (Math.copySign(1, direction.getX()) > 0) { txMin = (this.min.getX() - start.getX()) / direction.getX(); txMax = (this.max.getX() - start.getX()) / direction.getX(); final double tyMax; final Vector3d yNormal; if (Math.copySign(1, direction.getY()) > 0) { tyMin = (this.min.getY() - start.getY()) / direction.getY(); tyMax = (this.max.getY() - start.getY()) / direction.getY(); final double tzMax; final Vector3d zNormal; if (Math.copySign(1, direction.getZ()) > 0) { tzMin = (this.min.getZ() - start.getZ()) / direction.getZ(); tzMax = (this.max.getZ() - start.getZ()) / direction.getZ();
/** * Returns the first floating-point argument with the sign of the second * floating-point argument. */ public static double copySign(double magnitude, double sign) { return java.lang.Math.copySign(magnitude, sign); }
/** * Returns the first floating-point argument with the sign of the second * floating-point argument. */ public static float copySign(float magnitude, float sign) { return java.lang.Math.copySign(magnitude, sign); }
public static double convertNaN(double d) { if (Double.isNaN(d)) { return Math.copySign(0, d); } else { return d; } }
public static double adjustCoordinatesToResolution(double coord, double resolution) { long n = Math.round((Math.abs(coord) - 0.5 * resolution) / resolution); double output = n * resolution - 0.5 * resolution; return Math.copySign(output, coord); }
public static double adjustCoordinatesToResolution(double coord, double resolution) { long n = Math.round((Math.abs(coord) - 0.5 * resolution) / resolution); double output = n * resolution - 0.5 * resolution; return Math.copySign(output, coord); }
@Override protected ExprEval eval(double x, double y) { return ExprEval.of(Math.copySign(x, y)); } }
/** {@inheritDoc} * @since 3.2 */ public Decimal64 copySign(final Decimal64 sign) { return new Decimal64(Math.copySign(value, sign.value)); }
/** {@inheritDoc} * @since 3.2 */ public Decimal64 copySign(final double sign) { return new Decimal64(Math.copySign(value, sign)); }