Skip to content

Rational numbers: reduce absolute value #1052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mstranger opened this issue Jan 31, 2022 · 3 comments
Closed

Rational numbers: reduce absolute value #1052

mstranger opened this issue Jan 31, 2022 · 3 comments

Comments

@mstranger
Copy link
Contributor

Current tests do not consider the case, when a rational number can be reduced:

RationalNumbers.abs({2, 4}) = {2, 4}

Should the function abs in this exercise reduce a rational number?

@jiegillet
Copy link
Contributor

Hi @mstranger,
That's an excellent question! Yes, every function should reduce the output number.
The best place to make that explicit however, is on the problem-specifications repo, like this recent PR for the same exercise. In this way, every track would benefit from the change.

Would you be willing to open a PR there?
It would be great to have a test that makes sure that the output is reduced for every function.

@mstranger
Copy link
Contributor Author

Thanks @jiegillet, I created a PR.

@jiegillet
Copy link
Contributor

Nice, thank you!
I'll close the issue, please open a PR here with the new tests once that PR is merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants