/** * <p>Gets a fraction that is the positive equivalent of this one.</p> * <p>More precisely: <code>(fraction >= 0 ? this : -fraction)</code></p> * * <p>The returned fraction is not reduced.</p> * * @return <code>this</code> if it is positive, or a new positive fraction * instance with the opposite signed numerator */ public Fraction abs() { if (numerator >= 0) { return this; } return negate(); }
return isAdd ? fraction : fraction.negate();
/** * <p>Gets a fraction that is the positive equivalent of this one.</p> * <p>More precisely: <code>(fraction >= 0 ? this : -fraction)</code></p> * * <p>The returned fraction is not reduced.</p> * * @return <code>this</code> if it is positive, or a new positive fraction * instance with the opposite signed numerator */ public Fraction abs() { if (numerator >= 0) { return this; } return negate(); }
/** * <p>Gets a fraction that is the positive equivalent of this one.</p> * <p>More precisely: <code>(fraction >= 0 ? this : -fraction)</code></p> * * <p>The returned fraction is not reduced.</p> * * @return <code>this</code> if it is positive, or a new positive fraction * instance with the opposite signed numerator */ public Fraction abs() { if (numerator >= 0) { return this; } return negate(); }
/** * <p>Gets a fraction that is the positive equivalent of this one.</p> * <p>More precisely: <code>(fraction >= 0 ? this : -fraction)</code></p> * * <p>The returned fraction is not reduced.</p> * * @return <code>this</code> if it is positive, or a new positive fraction * instance with the opposite signed numerator */ public Fraction abs() { if (numerator >= 0) { return this; } return negate(); }
/** * <p>Gets a fraction that is the positive equivalent of this one.</p> * <p>More precisely: <code>(fraction >= 0 ? this : -fraction)</code></p> * * <p>The returned fraction is not reduced.</p> * * @return <code>this</code> if it is positive, or a new positive fraction * instance with the opposite signed numerator */ public Fraction abs() { if (numerator >= 0) { return this; } return negate(); }
/** * <p>Gets a fraction that is the positive equivalent of this one.</p> * <p>More precisely: <code>(fraction >= 0 ? this : -fraction)</code></p> * * <p>The returned fraction is not reduced.</p> * * @return <code>this</code> if it is positive, or a new positive fraction * instance with the opposite signed numerator */ public Fraction abs() { if (numerator >= 0) { return this; } return negate(); }
return isAdd ? fraction : fraction.negate();
return isAdd ? fraction : fraction.negate();
return isAdd ? fraction : fraction.negate();
return isAdd ? fraction : fraction.negate();
return isAdd ? fraction : fraction.negate();