-
Notifications
You must be signed in to change notification settings - Fork 231
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
quotient and modulus for non-integers are wrong #3340
Comments
I think they're correct. My understanding is that |
But that's just I should have also included an example from python for contrast: >>> 13.3 // 4.0
3.0
>>> 13.3 % 4.0
1.3000000000000007
>>> 13.3 // 4
3.0
>>> 13.3 % 4
1.3000000000000007
>>> 13.3 // (4/1)
3.0
>>> 13.3 % (4/1)
1.3000000000000007 I think this makes more sense, both mathematically and in terms of what is actually useful. Currently computing the non-zero value of i13 : 13.3 - 4 * floor(13.3 // 4)
o13 = 1.3 |
Ok, I think I'm convinced that it's wrong, too. :) Here's an article with a few different possibilities for how |
Unless I'm way off about what we want
//
and%
to mean, I think these are all wrong:M2/M2/Macaulay2/m2/reals.m2
Lines 213 to 226 in ec9e9ac
Some examples: (afterprints are silenced)
What's the point of having
//
be a synonym for/
, and why even define%
for non-integers if the answer is always zero anyway?!The text was updated successfully, but these errors were encountered: