Update instructions for rational numbers

Similarly to the recent changes made in the complex numbers exercise, here’s a proposed update for the rational numbers exercise

This is a lengthy exercise, so I may have made a few errors here and there.

1 Like

I’m also thinking that the definition of all used rational numbers could be placed right at the beginning:

Operations on rational numbers

Let r, r₁, r₂, be three rational numbers, where:

r = a / b
r₁ = a₁ / b₁
r₂ = a₂ / b₂

With this, we no longer need to mention their definition multiple times.

Another thing I just noticed: the specs don’t actually ask for raising a rational number to a floating-point number, so we can simplify the instructions by removing the relevant parts.

We avoided using subscripts when modifying the introduction.md file of the Complex-Numbers exercise to maintain consistency with the rest of the repository. I believe the same principle should be applied here as well.

@jagdishdrp

I’ll try to explain my reasoning for avoiding subscripts in the complex-numbers exercise:

  1. Not all superscripts displayed properly (a^2 might render correctly, but x^(a+bi) could have issues).
  2. Consequently, the exercise would have required a mix of the subscripts you introduced (which were fine) but no superscripts. While this wasn’t a major issue, it felt visually inconsistent to me at the time.

Thus, I preferred to avoid using superscripts or subscripts altogether. This decision could certainly be revisited in the future.

For other exercises, I’m not actively removing subscripts if they’re already in use. While there isn’t much consistency across exercises, we do aim for internal consistency within each exercise.

That said, if anyone feels that removing the subscripts here would improve the exercise, I’m open to feedback.

1 Like

A preferable approach, in my view, would be to retain what we already have in the exercises (which is what we’ve been doing) and discuss in a separate thread whether we should adopt subscripts across all exercises for consistency. Superscripts are likely not an option, as they don’t serve the same purpose as subscripts.