diff --git a/exercises/rational-numbers/description.md b/exercises/rational-numbers/description.md index bbeae447ea..33bfccc015 100644 --- a/exercises/rational-numbers/description.md +++ b/exercises/rational-numbers/description.md @@ -2,6 +2,12 @@ A rational number is defined as the quotient of two integers `a` and `b`, called the numerator and denominator, respectively, where `b != 0`. +~~~~exercism/note +Note that mathematically, the denominator can't be zero. +However in many implementations of rational numbers, you will find that the denominator is allowed to be zero with behaviour similar to positive or negative infinity in floating point numbers. +In those cases, the denominator and numerator generally still can't both be zero at once. +~~~~ + The absolute value `|r|` of the rational number `r = a/b` is equal to `|a|/|b|`. The sum of two rational numbers `r₁ = a₁/b₁` and `r₂ = a₂/b₂` is `r₁ + r₂ = a₁/b₁ + a₂/b₂ = (a₁ * b₂ + a₂ * b₁) / (b₁ * b₂)`.