Lines Matching defs:denominator

26  * <p>Contains a pair of {@code int}s representing the numerator and denominator of a
37 * <p>Equivalent to constructing a new rational with both the numerator and denominator
45 * <p>Equivalent to constructing a new rational with a positive numerator and a denominator
53 * <p>Equivalent to constructing a new rational with a negative numerator and a denominator
62 * any non-zero denominator.</p>
81 * <p>Create a {@code Rational} with a given numerator and denominator.</p>
83 * <p>The signs of the numerator and the denominator may be flipped such that the denominator
84 * is always positive. Both the numerator and denominator will be converted to their reduced
97 * @param denominator the denominator of the rational
101 public Rational(int numerator, int denominator) {
103 if (denominator < 0) {
105 denominator = -denominator;
109 if (denominator == 0 && numerator > 0) {
112 } else if (denominator == 0 && numerator < 0) {
115 } else if (denominator == 0 && numerator == 0) {
122 int gcd = gcd(numerator, denominator);
125 mDenominator = denominator / gcd;
133 * infinity (that is, the denominator is {@code 0}).</p>
140 * Gets the denominator of the rational
142 * <p>The denominator may return {@code 0}, in which case the rational may represent
146 * <p>The denominator will always return {@code 1} if the numerator is {@code 0}.
155 * <p>A {@code NaN} value occurs when both the numerator and the denominator are {@code 0}.</p>
167 * <p>An infinite value occurs when the denominator is {@code 0} (but the numerator is not).</p>
179 * <p>A finite value occurs when the denominator is not {@code 0}; in other words
219 * <li>Both have the same numerator and denominator in their reduced form</li>
223 * denominator by their greatest common divisor.</p>
255 * <li>All other values will return {@code "numerator/denominator"} where {@code numerator}
256 * and {@code denominator} are substituted with the appropriate numerator and denominator
289 // Bias the hash code for the first (2^16) values for both numerator and denominator
301 * @param denominator the denominator in a fraction
306 public static int gcd(int numerator, int denominator) {
315 int b = denominator;
330 * <p>The {@code double} is calculated by converting both the numerator and denominator
332 * denominator.</p>
334 * @return the divided value of the numerator and denominator as a {@code double}.
347 * <p>The {@code float} is calculated by converting both the numerator and denominator
349 * denominator.</p>
351 * @return the divided value of the numerator and denominator as a {@code float}.
365 * by dividing the numerator by the denominator; conversion for non-finite values happens
378 * @return the divided value of the numerator and denominator as a {@code int}.
399 * by dividing the numerator by the denominator; conversion for non-finite values happens
412 * @return the divided value of the numerator and denominator as a {@code long}.
436 * @return the divided value of the numerator and denominator as a {@code short}.
454 * against the other finite number by converting both rationals to a common denominator multiple