|
-
Jul 12th, 2003, 09:11 PM
#1
Thread Starter
Hyperactive Member
modulus confusion. basic question!
hello everyone!
I just discovered i've been treating % the wrong way, i always thought it was the number right after the decimal point. But i soon found out its the remainder on the fraction, such as this:
34%5
34/5 = (30 + 4)/5 = (30/5) + (4/5) = 6 + 4/5 = 4
right?
so how is
-34%-5 == -4?
I don't understand why it comes out to -4, can someone write it out like i did above and show me?
also how is 4%6 = 4?
thanks!
C¤ry Sanchez
Computer Science/Engineering
@ Penn State
IBM.zSeries Intern
Mandriva 2007
-
Jul 12th, 2003, 09:37 PM
#2
Hyperactive Member
-34%-5=-4
I believe that is because when a negative number divided by a negative number, it's remainder is a negative number unless you are talking about the result which is positive.
4%6 = 4
This is correct. The division result is zero and the remainder is 4.
-
Jul 13th, 2003, 12:54 PM
#3
Thread Starter
Hyperactive Member
Thanks for the reply but I still don't understand why it equals -4 or why 4%6 = 4?
Can you write it out like u were going to solve it on a piece of paper? Like I did above with 35%5;
Thanks
C¤ry Sanchez
Computer Science/Engineering
@ Penn State
IBM.zSeries Intern
Mandriva 2007
-
Jul 13th, 2003, 05:43 PM
#4
Frenzied Member
4%6=4 because 6 goes into 4 0 times with a remainder of 4...
-
Jul 13th, 2003, 10:16 PM
#5
Thread Starter
Hyperactive Member
OHhh! I get it now! I don't nkow what the hell i was doing above, thanks!!
C¤ry Sanchez
Computer Science/Engineering
@ Penn State
IBM.zSeries Intern
Mandriva 2007
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|