Jonario
Badges: 4
Rep:
?
#1
Report Thread starter 10 years ago
#1
What does MOD do and could you give me an example?

What does DIV do and could you give me an example?

Thank you
0
reply
tomfb
Badges: 0
Rep:
?
#2
Report 10 years ago
#2
(Original post by Jonario)
What does MOD do and could you give me an example?

What does DIV do and could you give me an example?

Thank you
Could you add some more information into your question.
a MOD as in a phpBB MOD?

DIV as in what language? Html, c# or what?
0
reply
unprinted
Badges: 19
Rep:
?
#3
Report 10 years ago
#3
Mentioning the language would be a start, but typically...

MOD - 'modulus', the remainder after an integer division. 10 MOD 3 = 1, 11 MOD 3 = 2, 12 MOD 3 = 0 etc. Different implementations of different languages have different ideas about what should happen if you're involving negative numbers (some reckon the remainder should always be positive, some allow it to be negative).

DIV - integer DIVision. 10 DIV 3 = 3, 11 DIV 3 = 3, 12 DIV 3 = 4 etc. Again, it gets interesting when you involve negative numbers, but (A DIV B) * B + (A MOD B) = A
1
reply
tomfb
Badges: 0
Rep:
?
#4
Report 10 years ago
#4
(Original post by unprinted)
Mentioning the language would be a start, but typically...

MOD - 'modulus', the remainder after an integer division. 10 MOD 3 = 1, 11 MOD 3 = 2, 12 MOD 3 = 0 etc. Different implementations of different languages have different ideas about what should happen if you're involving negative numbers (some reckon the remainder should always be positive, some allow it to be negative).

DIV - integer DIVision. 10 DIV 3 = 3, 11 DIV 3 = 3, 12 DIV 3 = 4 etc. Again, it gets interesting when you involve negative numbers, but (A DIV B) * B + (A MOD B) = A
Lol. I never even thought of a Modulo operation.
0
reply
Jonario
Badges: 4
Rep:
?
#5
Report Thread starter 10 years ago
#5
(Original post by tomfb)
Could you add some more information into your question.
a MOD as in a phpBB MOD?

DIV as in what language? Html, c# or what?
Visual basic sorry
0
reply
Jonario
Badges: 4
Rep:
?
#6
Report Thread starter 10 years ago
#6
(Original post by unprinted)
Mentioning the language would be a start, but typically...

MOD - 'modulus', the remainder after an integer division. 10 MOD 3 = 1, 11 MOD 3 = 2, 12 MOD 3 = 0 etc. Different implementations of different languages have different ideas about what should happen if you're involving negative numbers (some reckon the remainder should always be positive, some allow it to be negative).

DIV - integer DIVision. 10 DIV 3 = 3, 11 DIV 3 = 3, 12 DIV 3 = 4 etc. Again, it gets interesting when you involve negative numbers, but (A DIV B) * B + (A MOD B) = A
Thank you very much =)
0
reply
tomfb
Badges: 0
Rep:
?
#7
Report 10 years ago
#7
(Original post by Jonario)
Visual basic sorry
Ah ok, I was completely on the wrong tracks. Check the post by unprinted.
0
reply
Zodiac123
Badges: 0
Rep:
?
#8
Report 6 years ago
#8
(Original post by unprinted)
Mentioning the language would be a start, but typically...

MOD - 'modulus', the remainder after an integer division. 10 MOD 3 = 1, 11 MOD 3 = 2, 12 MOD 3 = 0 etc. Different implementations of different languages have different ideas about what should happen if you're involving negative numbers (some reckon the remainder should always be positive, some allow it to be negative).

DIV - integer DIVision. 10 DIV 3 = 3, 11 DIV 3 = 3, 12 DIV 3 = 4 etc. Again, it gets interesting when you involve negative numbers, but (A DIV B) * B + (A MOD B) = A
When writing the answer to DIV if it contains more than one Integer do you include all the Integers before the decimal or just the first Integer in the answer? Does this also apply to MOD as well but the other way around?
0
reply
unprinted
Badges: 19
Rep:
?
#9
Report 6 years ago
#9
Integer is the proper word for what primary school called a 'positive or negative whole number'. It can have many digits.

The answer to DIV is a single integer:

1 DIV 3 = 0
10 DIV 3 = 3
100 DIV 3 = 33
1000 DIV 3 = 333

So is the answer to MOD:

2 MOD 7 = 2
20 MOD 7 = 6
etc
0
reply
liam222222
Badges: 2
Rep:
?
#10
Report 2 years ago
#10
what is mod
0
reply
callum13ella
Badges: 1
Rep:
?
#11
Report 2 years ago
#11
shut up and choke me daddy
0
reply
callum13ella
Badges: 1
Rep:
?
#12
Report 2 years ago
#12
do you know tye casie wint. choke me daddy
0
reply
MUSHUMD
Badges: 1
Rep:
?
#13
Report 1 year ago
#13
Cheers mush it helped
0
reply
Aïmîne Sc
Badges: 1
Rep:
?
#14
Report 11 months ago
#14
12 div 10
0
reply
Hammad(214508)
Badges: 18
Rep:
?
#15
Report 1 month ago
#15
In basic termilonolgy:
MOD -> remainder
DIV -> quotient

so let's say 10/3
10 MOD 3 = 1 (3*3 = 9 so remainder 1)
10 DIV 3 = 3 (3 goes into 10, 3 times)
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Current uni students - are you thinking of dropping out of university?

Yes, I'm seriously considering dropping out (185)
14.06%
I'm not sure (59)
4.48%
No, I'm going to stick it out for now (387)
29.41%
I have already dropped out (37)
2.81%
I'm not a current university student (648)
49.24%

Watched Threads

View All