| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Dec 2004 Location: Ireland
Posts: 2,690
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Pascal - MOD help needed Hey, I have a test tomorrow on pascal and can't quite grasp the MOD function in pascal. -100 MOD 8 = -4 I thought it was the remainder? -100/8 = 12.5 answer = 5? Can someone clarify?
__________________ - ForumCures.com Quality Forum Posting Service |
| |
| | #2 (permalink) |
| Tech Support Join Date: Mar 2005
Posts: 4,944
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Maybe this would help? http://www.merlyn.demon.co.uk/pas-math.htm#DivMod |
| |
| | #3 (permalink) |
| New Member Join Date: Mar 2007
Posts: 16
![]() | that link is kinda crptic. MOD ( % ) is just remainder when you do long division. so 13 % 10 is 3 (because 13 divided by 10 is 1 remainder 3) and 5 % 2 is 1 (because 5 divided by 2 is 2 remainder 1) MOD has lots of uses, for example it can test to see if a number is even or odd if ( variable % 2 == 0) number is even i took pascal in junior high, i cant believe they still teach it. Good luck mate.(in your example, remember there are no decimals in long division) |
| |