Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

looking for clear explanation modulo operator

Participant ,
Dec 24, 2010 Dec 24, 2010

Hi, can someone please explain to me (a person with no mathematical background) the modulo operator. I need to understand it, because I'm learning

PHP at the moment.

Thanks!!!

TOPICS
Server side applications
399
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 24, 2010 Dec 24, 2010

It's the remainder of an integer division operation. For example, consider 6/4 (six divided by four):

For floating point math, the answer is: 1.5

But, for integer math, the fraction is thrown away and the answer is: 1. There's no way to know if there's a remainder for the division operation, so the modulo operation is provided to get the remainder, which is 2.

HTH,

Randy

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 24, 2010 Dec 24, 2010
LATEST

BITESGIRL wrote:

Hi, can someone please explain to me (a person with no mathematical background) the modulo operator.

Please do not post the same question in multiple forums. You also posted this question as a private message to me. Doing so wastes the valuable time of everyone who responds, and is likely to result in your future questions being ignored.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines