Floating Point Types

Floating Point Types

C++ defines three floating points datatypes: float, double and long double. Some existing implementations support only two (and in some cases only one) of these three. On such implementations, double and long double are interchangeable.

Your implementation documents the floating point datatypes it supports and their characteristics in the header file or . According to the IEEE specification, type float occupies 32 bits (4 bytes) of which 24 represent the mantissa, 7 bits contain the exponent and 1 bit holds the sign. Type double occupies 64 bits (8 bytes) 53 of which are for the mantissa, 10 bits are for the exponent and one bit is for the sign. Type long double occupies 80 bits (10 bytes) of which 64 are for the mantissa, 16 bits are for the exponent and one bit is the sign bit.

long double can represent the largest values and provides the highest precision, namely 18 digits after the decimal point. double has a precision of 15 digits and float’s precision is limited to six digits.

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular