An integer is a positive or negative whole number, including 0.

For example, 5, 0, 321, and -17 are all integers, while 5.2, -101.88, and 3⁄4 are not.

Integers are sometimes called "whole numbers" or "counting numbers".

In computer science, numbers fall into different categories like integers, floats, short, and long.

Floats, or floating point numbers, are numbers that support decimal points. Integers are numbers without a fractional component, and don't support decimal points.

While some programming languages define these different types of numbers, others don't.

For example, in C you need to store the number 3 as an integer (int), and 4.5 as a float (float).

But JavaScript treats all numbers as floats behind the scenes. You can read more about the way JavaScript encodes numbers here.

Related Tech Terms: