Unstoppable Domains โ€” AI Assistant

Pascal - MOD help needed

SpaceshipSpaceship
Watch
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?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
0
•••
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)
 
0
•••
Appraise.net
Spaceship
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back