Skip to content

Commit 84dd4dd

Browse files
authored
doc: Minor clarification (#35921)
In the constructors chapter there is a minor ambiguity about in the description of the `OurRational` example. Make it clear that the inner constructor rejects only 0/0, not 0/1 or 1/0.
1 parent cfd7f48 commit 84dd4dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/src/manual/constructors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ and `den::T` indicate that the data held in a `OurRational{T}` object are a pair
465465
`T`, one representing the rational value's numerator and the other representing its denominator.
466466

467467
Now things get interesting. `OurRational` has a single inner constructor method which checks that
468-
both of `num` and `den` aren't zero and ensures that every rational is constructed in "lowest
468+
`num` and `den` aren't both zero and ensures that every rational is constructed in "lowest
469469
terms" with a non-negative denominator. This is accomplished by dividing the given numerator and
470470
denominator values by their greatest common divisor, computed using the `gcd` function. Since
471471
`gcd` returns the greatest common divisor of its arguments with sign matching the first argument

0 commit comments

Comments
 (0)