Skip to content

Add tolerance checks for tests in space-age#19

Merged
kytrinyx merged 1 commit intoexercism:masterfrom
mikecoop:master
Oct 7, 2014
Merged

Add tolerance checks for tests in space-age#19
kytrinyx merged 1 commit intoexercism:masterfrom
mikecoop:master

Conversation

@mikecoop
Copy link
Copy Markdown
Contributor

@mikecoop mikecoop commented Oct 6, 2014

The tests numbers are rounded off but don't have any tolerance checking.
They fail if the number isn't exactly the same.

The tests numbers are rounded off but don't have any tolerance checking.
They fail if the number isn't exactly the same.
@kytrinyx
Copy link
Copy Markdown
Member

kytrinyx commented Oct 6, 2014

It seems like the tests are explicitly stating that the result should be rounded. I'm not sure that this is correct, but I think that it's worth discussing.

One thing that I think would be important to avoid, is cumulative rounding errors (if Earth gets rounded, and all others are based off of Earth, would the tests pass or fail?)

@mikecoop
Copy link
Copy Markdown
Contributor Author

mikecoop commented Oct 6, 2014

It's not a problem if the results should be rounded to two decimal places but I think it should explicitly say that in the problem. It took me a while to figure out what I was doing wrong when I was solving the problem even though my numbers were correct.

@kytrinyx
Copy link
Copy Markdown
Member

kytrinyx commented Oct 7, 2014

Hm. Yeah, that's a good point. I don't even know if it's explicit or that all the languages do it in the same way. I think that as long as the tolerance is small enough that we wouldn't allow accumulated rounding errors this is fine. Merging.

kytrinyx added a commit that referenced this pull request Oct 7, 2014
Add tolerance checks for tests in space-age
@kytrinyx kytrinyx merged commit 8e82965 into exercism:master Oct 7, 2014
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