Z
Zayd Connor
Maybe i need to get some sleep, but can someone explain how modulos
work?
Thanks
work?
Thanks
Zayd said:Maybe i need to get some sleep, but can someone explain how modulos
work?
Thanks
Zayd Connor said:Maybe i need to get some sleep, but can someone explain how modulos
work?
Maybe i need to get some sleep, but can someone explain how modulos
work?
And did you Google modulo or module yourself to see how useful the
result really is?
Rob said:This seems completely unnecessary. There was already a great response
from Brian who not only directly addressed the "modulos", but also
picked up and pointed out (subtly) that the question might have been
about "modules". Something that makes perfect sense, but I certainly
didn't see that possibility.
And did you Google modulo or module yourself to see how useful the
result really is? If you're going to simply shout lmgtfy, at least put
"ruby" in there, too (well, for module, not for modulo ;-)
-Rob
Rob Biedenharn http://agileconsultingllc.com
(e-mail address removed)
Though there is one thing I would like to point out: 0 % 7 = 0Thanks guys,(singing) I can see clearly now the rain is gone . Maybe I
should have been more clear and added the % sign when mentioning modulo,
so I wouldn't confuse anyone thinking I meant modules
Thanks
Michael said:Though there is one thing I would like to point out: 0 % 7 = 0
So 'remainder' is not strictly true
Many people I know and work with simplify the modulo operator toSebastian said:Sorry I don't follow you. What's the remainder of 0/7 if not 0?
0-7*0 is 0, is it not?
Confused,
Sebastian
Many people I know and work with simplify the modulo operator to
themselves as remainder, so mentally (whether or not it is correct)
assume 0/7 = 0 r 7
I am just making an explicit example of this not necessarily obvious
case. It's totally fine when one knows the semantics of modulo,
it's the simplification to remainder that many people make that
causes problems here.
Michael
Michael said:Many people I know and work with simplify the modulo operator to
themselves as remainder, so mentally (whether or not it is correct)
assume 0/7 = 0 r 7
Sorry for confusing everyone here, I just know of a particular caseSebastian said:Maybe I'm slow, but I don't get it.
You're saying that many people assume that x % y is the same as the remainder
of dividing x by y, right? I don't see anything wrong with that.
If I understand you correctly, you're also saying that this assumption is
wrong in the case of 0%7. I don't understand why that should be the case. The
remainder of 0/7 is 0, right? And 0%7 is also 0, so where's the problem?
Still confused,
Sebastian
Robert Klemme said:
Maybe I'm slow, but I don't get it.
You're saying that many people assume that x % y is the same as the remainder
of dividing x by y, right? I don't see anything wrong with that.
If I understand you correctly, you're also saying that this assumption is
wrong in the case of 0%7. I don't understand why that should be the case. The
remainder of 0/7 is 0, right? And 0%7 is also 0, so where's the problem?
Sorry for confusing everyone here, I just know of a particular case
where 0%7 =3D 7 was assumed.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.