Last year, James Colvin wrote a guide to understanding the different data types that are commonly used by programmers. While he focused specifically on Boolean data, he also talks about others. Since it’s been a while, we thought it was time to revisit his guide!
“In a broad sense, data types are ways to represent different kinds of information in a computer processor or FPGA. Today we will be discussing booleans, integers, chars, and floating point numbers, all of which are commonly known as primitive data types,” said James.
Okay, a quick run-through.
Boolean data is that which represents “true” or “false” information. This is represented by ones and zeroes. A character,or a char, is an array of bits that define the visual representation of a symbol. When you see ASCII characters, this is what they are — the appropriate array of bits. Integers, usually shortened to just “int” in programming, are the standard way to store numbers within your code. These are whole numbers, so any decimals will be truncated. Finally, there is the floating point data type. A “float” accepts up to seven decimal places via a type of scientific notation that uses of 32 bits, eight of which are devoted to the decimals.
All of these data types have their specific uses and applications, it’s just a matter of deciding which is right for your programming endeavor! For more in-depth informations, see James’ original post.