Skip to content
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

Fix types in complex numbers #1467

Merged
merged 2 commits into from
May 25, 2024
Merged

Conversation

angelikatyborska
Copy link
Member

Reported on the forum: http://forum.exercism.org/t/mismatch-between-spec-and-test-on-complex-numbers/10850

I left abs as returning float because :math.sqrt always returns a float. But maybe that doesn't matter... it wouldn't break the test to return an integer from that function if the decimal part is equal to zero. assert_delta_in, used for all assertions, allows mixing up integers and floats.

Copy link
Contributor

Thank you for contributing to exercism/elixir 💜 🎉. This is an automated PR comment 🤖 for the maintainers of this repository that helps with the PR review process. You can safely ignore it and wait for a maintainer to review your changes.

Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:

  • General steps

    • 🏆 Does this PR need to receive a label with a reputation modifier (x:size/{tiny,small,medium,large,massive})? (A medium reputation amount is awarded by default, see docs)
  • Any exercise changed

    • 👤 Does the author of the PR need to be added as an author or contributor in <exercise>/.meta/config.json (see docs)?
    • 🔬 Do the analyzer and the analyzer comments exist for this exercise? Do they need to be changed?
    • 📜 Does the design file (<exercise>/.meta/design.md) need to be updated to document new implementation decisions?
  • Practice exercise changed

    • 🌲 Do prerequisites, practices, and difficulty in config.json need to be updated?
    • 🧑‍🏫 Are the changes in accordance with the community-wide problem specifiations?

Automated comment created by PR Commenter 🤖.

Copy link
Contributor

@jiegillet jiegillet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, it doesn't hurt to be more general.
I think I would also use number for abs so that all real types are the same. It's conceivable to have an implementation that returns an integer, it's unlikely but not incorrect.

@angelikatyborska angelikatyborska merged commit 6855116 into main May 25, 2024
9 of 10 checks passed
@angelikatyborska angelikatyborska deleted the fix-types-in-complex-numbers branch May 25, 2024 11:07
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

Successfully merging this pull request may close these issues.

2 participants