swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    Related Concepts  
operator  

complement

 
 

Return type: Integer
Returns:       A bit sequence.

Syntax

complement numeric-expression


Purpose

The complement of two bit sequences is a new sequence where each bit is "flipped". In other words, each bit is:

For example, the complement of 0 is "111111111111111111111111111111111111" base 2. (This actually results in a negative number on most systems because the topmost bit is a sign bit. A "1" in this position usually indicates a negative number. This is one reason to avoid dealing with numeric expressions as both bit sequences and numbers at the same time.)

Other languages sometimes refer to this operator as a "bit-wise not" because the operation is analogous to the logical "not" operation. To avoid confusion, OmniMark reserves the operator "!" (not) for the logical "not" operation.

Usage example:

  set c to complement 1
  
  set c to c mask complement 1

      Related Concepts
   Bit-oriented arithmetic
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:33:48 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.