Operators

From TRCCompSci - AQA Computer Science
Revision as of 10:55, 15 December 2016 by QuantumFluctuator (talk | contribs) (Created page with "There are five types of mathematical operator, and four types of bitwise operator.<br /> <h2>Mathematical operators</h2> *Addition - performed using the "+" operator; adds val...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There are five types of mathematical operator, and four types of bitwise operator.

Mathematical operators

  • Addition - performed using the "+" operator; adds values together.
  • Subtraction - performed using the "-" operator; subtracts values.
  • Multiplication - performed using the "*" operator; multiplies values together.
  • Division - performed using the "/" operator; divides values.
  • Modulus - performed using the "%" operator; finds the remainder of a division between values.

Bitwise operators

  • AND - performed using "&" or "&&"; returns true if both inputs are true.
  • OR - performed using "|" or "||"; returns true if one or both inputs are true.
  • XOR - performed using "^"; returns true if both inputs are different.
  • NOT - performed using "!"; returns false if true, or true if false.