-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
grains:total impacted by rounding errors #106
Comments
Hello @Gamecock, could you please post your
@jonmcalder Can you reproduce the test fail that Mike reports? |
Matrix products: default locale: attached base packages: loaded via a namespace (and not attached): |
Thank you. The easiest possible culprit to exclude is your R v3.4.3 (although there should have been other users noticing this problem then). Can you try upgrading to 3.5.x from one of the mirrors? |
I'll try, but isn't the expected result that if you try to compare two large numbers beyond the size of an Integer you lose precision? |
Matrix products: default locale: attached base packages: loaded via a namespace (and not attached): |
Same behavior, this should fail.
The solution is: |
Ah, no I see what you mean. Which "thread for more discussion" do you mean? @jonmcalder, @jkanche & @amoradell: What do you think about |
Sorry for the delayed response - I'm travelling at the moment so haven't got much capacity for keeping tabs on issues here. Am I correct in saying that the issue @Gamecock is raising here is the same as referred to in #84? Essentially base R doesn't provide support for large integers and we didn't have consensus previously on how to deal with this. My sense (revisiting it again now), is that the issue of precision is in some ways fundamental to the problem and we should have a way of supporting more precise testing for the exercise. Two potential solutions come to mind:
|
@jonmcalder that is the correct issue, I didn't think to look through closed issues. I have sufficient skills to do the work, but don't have enough experience with r to determine the correct path. |
+1 for the 2nd option. |
Ok cool. I'm happy with the second option too. @Gamecock are you happy to get started on a PR and then raise any further questions on implementation details with @katrinleinweber or me? |
Yes,
I'll update the exercise, and then seek your input about where in the
track to place it.
…On Fri, Sep 7, 2018 at 2:03 AM Jon Calder ***@***.***> wrote:
Ok cool. I'm happy with the second option too. @Gamecock
<https://github.com/Gamecock> are you happy to get started on a PR and
then raise any further questions on implementation details with
@katrinleinweber <https://github.com/katrinleinweber> or me?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#106 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFkhSp0m5gcCXvobl23IWCa1a8kYZQnhks5uYgwagaJpZM4WC89b>
.
|
I approve second option. I suppose that core exercices and easy ones should be made with R base package. |
Becuase total is a float it is actually comparing:
`Error: Test failed: 'returns the total number of square on the board'
If you use option(digits = 22) you can see:
* total() not equal to 18446744073709551616.`Test was supposed to be:
expect_equal(total(), 18446744073709551615)
See thread for more discussion. Do you want to teach bigInts and importing libraries this early in the track?
The text was updated successfully, but these errors were encountered: