mod operator

can someone explain to me the % in java a little more? i can't seem to quite grasp it, any help would be amazing
[120 byte] By [gervaismainlinea] at [2007-11-27 7:29:08]
# 1
Do you remember when you did division in school and you had a remainder?
cotton.ma at 2007-7-12 19:09:17 > top of Java-index,Java Essentials,New To Java...
# 2
haha yes i do, but i guess i shouldve been more specific. i was just wondering what exactly of the remainder is suppose to return, like 10/3 = 3.33 so would 10%3 = .33?
gervaismainlinea at 2007-7-12 19:09:17 > top of Java-index,Java Essentials,New To Java...
# 3

> haha yes i do, but i guess i shouldve been more

> specific. i was just wondering what exactly of the

> remainder is suppose to return, like 10/3 = 3.33 so

> would

> 10%3 = .33?

Division is integer division not decimal.

So 10/3 = 3

10 % 3 = 1

cotton.ma at 2007-7-12 19:09:17 > top of Java-index,Java Essentials,New To Java...
# 4
thank you so much! looking at what you just said a lightbulb came on in my head, i have no idea what i was thinking before. thank you so much you dont know how grateful i am for that.
gervaismainlinea at 2007-7-12 19:09:17 > top of Java-index,Java Essentials,New To Java...
# 5
Here's something you can try when you get Java installed on your computer: write a little program containing this line of codeSystem.out.println(10 % 3);and run it. See what comes out.
DrClapa at 2007-7-12 19:09:17 > top of Java-index,Java Essentials,New To Java...