Appendix B. Data Types

There are different categories of data. For instance, think about the data on an ID card. The card has numbers to store weight, height, date of birth, street address, and postal code. It has words to store a person’s name and city. There’s also image data (a photo) and often an organ donor choice, which is a yes/no decision. In Processing, we have different data types to store each kind of data. Each of the following types is explained in more detail elsewhere in the book, but this is a summary.

Name

Description

Range of values

int

Integers (whole numbers)

−2,147,483,648 to 2,147,483,647

float

Floating-point values

−3.40282347E+38 to 3.40282347E+38

boolean

Logical value

true or false

char

Single character

A–z, 0–9, and symbols ...

Get Getting Started with Processing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.