Operators

From SCI Wiki
Revision as of 17:33, 5 August 2013 by Andrew Branscom (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Arithmetic Operators

Use the arithmetic operators to perform mathematical computations.

  • + (addition)
  • - (subtraction)
  • * (multiplication)
  • / (division)
  • % (modulus operator)
  • ++(increment)
  • -- (decrement)

Bitwise Operators

Use the bitwise operators to modify the individual bits rather than the number.

  • & (bitwise AND)
  • | (bitwise inclusive OR)
  • ^ (bitwise exclusive OR)
  • << (bitwise shift right)
  • >> (bitwise shift left)
  • bnot (inverts an integer's bits)
  • not (inverts TRUE/FALSE expressions)
  • neg (negates integers)

Relational Operators

Use the arithmetic operators to perform mathematical computations.

  • == (equal to)
  • <> (not equal to)
  • < (less than)
  • <u (unsigned less than)
  • <= (less than or equal to)
  • <=u (unsigned less than or equal to)
  • > (greater than)
  • >u (unsigned greater than)
  • >= (greater than or equal to)
  • >=u (unsigned greater than or equal to)