Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - % modulus operator (binary) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 %                   Modulus operator (binary)
------------------------------------------------------------------------------
 Syntax
   nNumber1 % nNumber2

 Arguments
   nNumber1 is the dividend of the division operation.
   nNumber2 is the divisor of the division operation.

 Description
   The % operator returns a number representing the remainder of nNumber1
   divided by nNumber2.

 Example
   #define EXAMPLE_OPERATOR
   #include example.hdr

   proc Test_925
   // ?  3 %  0            // compiler error
      ?  3 % -2            // prints  1
      ? -3 %  2            // prints -1
   // ? -3 %  0            // compiler error
      ? -1 %  3            // prints -1
      ? -2 %  3            // prints -2
      ?  2 % -3            // prints  2
      ?  1 % -3            // prints  1
   endproc

   proc main
   Test_925()
   endproc

See Also: moddbl()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson