O'Reilly logo

C Programming: Visual Quickstart Guide by Marc Liyanage, Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Selecting a Number Type

Choosing the right type of number to use in a C application is critical, as it affects both the range of computational possibilities and the overall performance. Each of the available number types has its own strengths and weaknesses. More important, each has its own dangers, which can trip up even a thoughtful programmer.

C supports two broad types of numbers: integers (1, 2345, -8) and floating points (3.14, -0.8, 23.2). The latter always contain decimal points, whereas the former never do. Each of these is then further broken down into subtypes based on their size. Floats can also be represented as doubles, which are twice as accurate (more on this later). Also, integers (but not floats and doubles) can be defined as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required