Adds the value of this fraction to another, returning the result in reduced form. The algorithm follows Knuth, 4.5.1. @param fraction the fraction to add, must not be null @return a Fraction instance with the resulting values @throws NullPointerException if the fraction is {@code n
(final Fraction fraction)
| 503 | * {@code Integer.MAX_VALUE} |
| 504 | */ |
| 505 | public Fraction add(final Fraction fraction) { |
| 506 | return addSub(fraction, true /* add */); |
| 507 | } |
| 508 | |
| 509 | /** |
| 510 | * Implements add and subtract using the algorithm described in <a href="https://www-cs-faculty.stanford.edu/~knuth/taocp.html"> |