Data types
Table of Contents
Introduction
We now know about variables: to store something in the computer's memory, we need to name it. What type of information can we store? In spoken language we have nouns, verbs, adverbs, etc. In programming we can use numbers, logicals and character strings.
Numbers
Numbers can be:
- integers or whole numbers, such as
1
,2
,3
- doubles with decimal point values, such as
1.25
,3.75
- complex numbers with imaginary components such as
3 + 2i
,9 + 6i
Logicals
Logicals, also known as Booleans, have two possible values:
TRUE
FALSE
Logicals are useful when comparing data.
Character strings
Character strings are made up of letters, numbers and special characters and are generally surrounded by quotation marks. Here we have Research and Platforms as two separate character strings: "Research", "Platrforms"
.