/** * Computes a new DoubleDouble object whose value is <tt>(this - y)</tt>. * * @param y the subtrahend * @return <tt>(this - y)</tt> */ public final DD subtract(double y) { return add(-y); }
/** * Computes a new DoubleDouble object whose value is <tt>(this - y)</tt>. * * @param y the subtrahend * @return <tt>(this - y)</tt> */ public final DD subtract(DD y) { return add(y.negate()); }
/** * Rounds this value to the nearest integer. * The value is rounded to an integer by adding 1/2 and taking the floor of the result. * Special cases: * <ul> * <li>If this value is NaN, returns NaN. * </ul> * * @return this value rounded to the nearest integer */ public DD rint() { if (isNaN()) return this; // may not be 100% correct DD plus5 = this.add(0.5); return plus5.floor(); }
DD cy = DD.valueOf(c.y); DD aTerm = (ax.multiply(ax).add(ay.multiply(ay))) .multiply(triAreaDDSlow(bx, by, cx, cy, px, py)); DD bTerm = (bx.multiply(bx).add(by.multiply(by))) .multiply(triAreaDDSlow(ax, ay, cx, cy, px, py)); DD cTerm = (cx.multiply(cx).add(cy.multiply(cy))) .multiply(triAreaDDSlow(ax, ay, bx, by, px, py)); DD pTerm = (px.multiply(px).add(py.multiply(py))) .multiply(triAreaDDSlow(ax, ay, bx, by, cx, cy)); DD sum = aTerm.subtract(bTerm).add(cTerm).subtract(pTerm); boolean isInCircle = sum.doubleValue() > 0;
/** * Computes a new DoubleDouble object whose value is <tt>(this - y)</tt>. * * @param y the subtrahend * @return <tt>(this - y)</tt> */ public final DD subtract(double y) { return add(-y); }
/** * Computes a new DoubleDouble object whose value is <tt>(this - y)</tt>. * * @param y the subtrahend * @return <tt>(this - y)</tt> */ public final DD subtract(DD y) { return add(y.negate()); }
double d2 = diffSq.hi * (x * 0.5); return axdd.add(d2);
/** * Rounds this value to the nearest integer. * The value is rounded to an integer by adding 1/2 and taking the floor of the result. * Special cases: * <ul> * <li>If this value is NaN, returns NaN. * </ul> * * @return this value rounded to the nearest integer */ public DD rint() { if (isNaN()) return this; // may not be 100% correct DD plus5 = this.add(0.5); return plus5.floor(); }
DD cy = DD.valueOf(c.y); DD aTerm = (ax.multiply(ax).add(ay.multiply(ay))) .multiply(triAreaDDSlow(bx, by, cx, cy, px, py)); DD bTerm = (bx.multiply(bx).add(by.multiply(by))) .multiply(triAreaDDSlow(ax, ay, cx, cy, px, py)); DD cTerm = (cx.multiply(cx).add(cy.multiply(cy))) .multiply(triAreaDDSlow(ax, ay, bx, by, px, py)); DD pTerm = (px.multiply(px).add(py.multiply(py))) .multiply(triAreaDDSlow(ax, ay, bx, by, cx, cy)); DD sum = aTerm.subtract(bTerm).add(cTerm).subtract(pTerm); boolean isInCircle = sum.doubleValue() > 0;
double d2 = diffSq.hi * (x * 0.5); return axdd.add(d2);