Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . The Guide To CA-Clippe - <b>mod()*</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 MOD()*
 Return dBASE III PLUS modulus of two numbers
------------------------------------------------------------------------------
 Syntax

     MOD(<nDividend>, <nDivisor>) --> nRemainder

 Arguments

     <nDividend> is the dividend of the division operation.

     <nDivisor> is the divisor of the division operation.

 Returns

     MOD() returns a number representing the remainder of <nDividend> divided
     by <nDivisor>.

 Description

     MOD() is a numeric function that emulates the dBASE III PLUS MOD()
     function.  It is implemented using the CA-Clipper modulus operator (%).
     Note that there are differences between the dBASE III PLUS MOD()
     function and the CA-Clipper modulus operator which are described in the
     following table:

     Differences Between dBASE III PLUS MOD() Function
     and the CA-Clipper Modulus Operator
     ------------------------------------------------------------------------
     Dividend   Divisor   Modulus Operator   MOD()   dBASE III PLUS
                                                     MOD() function
     ------------------------------------------------------------------------
      3            0            Error        Error          3
      3           -2              1           -1           -1
     -3            2             -1            1            1
     -3            0            Error        Error         -3
     -1            3             -1            2            2
     -2            3             -2            1            1
      2           -3              2           -1           -1
      1           -3              1           -2           -2
     ------------------------------------------------------------------------

     MOD() is supplied as a compatibility function and therefore not
     recommended.  It is superseded entirely by the modulus operator (%).

 Notes

     .  Zero divisor in dBASE III PLUS: In dBASE III PLUS, a zero
        divisor returns the dividend for every value of the dividend.  In
        CA-Clipper, by contrast, the modulus of any dividend using a zero
        divisor causes a runtime error.

     .  Zero divisor in earlier versions: In versions of CA-Clipper
        prior to Summer '87, a modulus operation with a zero divisor returned
        zero for all dividends.  In Summer '87 and later versions, it returns
        a runtime error.

 Files:  Library is EXTEND.LIB, source file is SOURCE\SAMPLE\MOD.PRG.

See Also: %

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