opfart.blogg.se

Rational numbers exercises
Rational numbers exercises










rational numbers exercises

The difference of two rational numbers r₁ = a₁/b₁ and r₂ = a₂/b₂ is r₁ - r₂ = a₁/b₁ - a₂/b₂ = (a₁ * b₂ - a₂ * b₁) / (b₁ * b₂). The absolute value |r| of the rational number r = a/b is equal to |a|/|b|. In those cases, the denominator and numerator generally still can't both be zero at once. 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. Note that mathematically, the denominator can't be zero.












Rational numbers exercises