From the course: C Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Floating point types

Floating point types - C Tutorial

From the course: C Essential Training

Floating point types

- [Instructor] C provides the common floating point types. This is float-types.cpp from Chapter four of the Exercise Files. C provides these floating point types if we come down here line 13, we have the float type and then line on 14, we have the double type, and then on line 15, the long double type. On most modern systems, the float type is 32-bits precision to about seven digits. The double type, is 64-bits giving us a precision of about 16 digits. And the long double type, may be the same as double or it may be something larger like an IEEE long double, that may give us more precision. On many systems including this one here which is an Apple with the M1 chip, which is the ARM 64 running Apple clang, the long double type is simply a synonym for double. This is also true on Microsoft Visual C even on 64-bit systems, the long double is simply a synonym for double. On Intel® MAX® and on other Intel systems running…

Contents