difference between double and float

Опубликовано: 09 Октябрь 2024
на канале: The Digital Folks
13,530
385

difference between double and float

What is the difference between double and float ?

Float is of 4 bytes, while double is of 8 bytes.

Both are having 1 sign bit.
Float is having 8 bits for exponent, while double is having 11 bits for exponent.
23 bits for value in float, while 52 bits are there for double.

Float is having 7 decimal digits of precision , while double can give 15 decimal digits of precision.

So, we can use double for more accurate value.

#shorts #cprogramming#double #float #bydubebox