Modulus–binary

 %
 Modulus--binary                                 (Mathematical)
------------------------------------------------------------------------------
 Syntax

     <nNumber1> % <nNumber2>

 Type

     Numeric

 Operands

     <nNumber1> is the dividend of the division operation.

     <nNumber2> is the divisor of the division operation.

 Description

     % returns a number representing the remainder of <nNumber1> divided by
     <nNumber2>.

 Notes

     .  Seeking the modulus of any dividend using a zero as the
        divisor causes a runtime error.  In versions of CA-Clipper prior to
        Summer '87, a modulus operation with a zero divisor returned zero.

 Examples

     .  This example shows modulus results using different operands:

        ?  3 %  0            // Result: Runtime error
        ?  3 % -2            // Result:  1
        ? -3 %  2            // Result: -1
        ? -3 %  0            // Result: Runtime error
        ? -1 %  3            // Result: -1
        ? -2 %  3            // Result: -2
        ?  2 % -3            // Result:  2
        ?  1 % -3            // Result:  1

See Also: * ** + – / = (compound) MOD()* SET FIXED

One response to “Modulus–binary

  1. Pingback: CL_Operators | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.