# Types

### Types

Watch this video:

### Atomic types

### What type?

### Integers

Create a vector of integers from one to five. Can you imagine why you might want to use integers instead of numbers/doubles?

`c(1L, 2L, 3L, 4L, 5L)`

### Floating point arithmetic

Computers must use a finite amount of memory to store decimal numbers (which can sometimes require infinite precision). As a result, some decimals can only be saved as very precise approximations. From time to time you’ll notice side effects of this imprecision, like below.

Compute the square root of two, square the answer (e.g. multiply the square root of two by the square root of two), and then subtract two from the result. What answer do you expect? What answer do you get?

```
sqrt(2) * sqrt(2) - 2
sqrt(2)^2 - 2
```

### Vectors

### Character or object?

One of the most common mistakes in R is to call an object when you mean to call a character string and vice versa.