Data types

You will have met data types before in ICT when using databases or spreadsheets. Let's take a look at some different types of data...

Numeric operations

Normal numeric operations can be used as part of your code...

Operation Description Operator Example
Addition Add one value to another
Subtraction Subtract one value from another
Mulitplication Multiply two or more values togther
Division Divide one value by another
Mod Divide one number by another and only keep the remainder
x=y MOD z
Div Divide on value by another and only keep the quotient
x = y DIV z

Boolean operations

Boolean operations can be used to perform conditional tests for selection (IF statements) and Iterative constructs (check when to exit a loop). For more detail on this go back to the binary logic section

Operation Description Operator Example
AND Performs logical AND operation
AND [&&]

if ((x>y> AND (x>z))

if ((x>y) && (x>z))

OR Performs logical OR operation
OR [| |]

if ((x>y> OR (x>z))

if ((x>y) | | (x>z))

NOT Performs logical NOT operation
NOT [!]

while (!found)

while (NOT found)