Corrected minimum int value in intro of "Data Types in C" in the C Guide (#24692)

* Corrected minimum int value in intro

As described in the "Standard Integers" section, at minimum and int can store values -32,768 to 32,767.  The negative value was incorrectly listed as -32,767 in the "Data Types in C" section.

* fix: typo
This commit is contained in:
Daniel
2018-12-11 03:23:35 -05:00
committed by Aditya
parent 58e61b2df6
commit ba11ff267a

View File

@ -4,7 +4,7 @@ title: Data Types in C
# Data Types in C
There are several different ways to store data in C, and they are all unique from each other. The types of data that information can be stored as are called data types. C is much less forgiving about data types than other languages. As a result, it's important to make sure that you understand the existing data types, their abilities, and their limitations.
One quirk of C's data types is that they depend entirely on the hardware that you're running your code on. An `int` on your laptop will be smaller than an `int` on a supercomputer, so knowing the limitations of the hardware you're working on is important. This is also why the data types are defined as being minimums- an `int` value, as you will learn, is at minimum -32767 to 32767: on certain machines, it will be able to store even more values than this.
One quirk of C's data types is that they depend entirely on the hardware that you're running your code on. An `int` on your laptop will be smaller than an `int` on a supercomputer, so knowing the limitations of the hardware you're working on is important. This is also why the data types are defined as being minimums- an `int` value, as you will learn, is at minimum -32768 to 32767: on certain machines, it will be able to store even more values than this.
There are two categories that we can break this into: integers, and floating point numbers. Integers are whole numbers. They can be positive, negative, or zero. Numbers like -321, 497, 19345, and -976812 are all perfectly valid integers, but 4.5 is not because 4.5 is not a whole number.