-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Cars-assemble: fix tests failing due to floating point precision #610
Conversation
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
I've just realized that my PR introduces a small typo . I'll correct it when it's reopened. |
|
||
(deftest ^{:task 1} production-rate-speed-7-test | ||
(deftest ^{:task 1} production-rate-speeed-7-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change intentional? The validate exercise step should fail here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the typo i'm talking about.
@bobbicodes Do you have some time to review this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I suppose this would fix a lot of problems with this exercise, which is not supposed to be a challenge, it should be simple at this point. I'll wait to merge it until the typo is fixed.
It's ready. Thanks! |
A simple fix for the issue described below:
https://forum.exercism.org/t/cant-solve-cars-assemble-because-of-floating-point-precision/9242
The current tests check if two double numbers x, y are equal, and as a result some of them are failing when the numbers aren't identical. Two possible solutions:
abs(x-y)<epsilon
.This PR employs the second approach.