Float, Double and Long Double! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Float, Double and Long Double!

I just dont understand the way they are counting. it says floats are 4 bytes, double is 8 bytes, and long double is 16 bytes. 8 bits = 1 byte. i get why tho, using double and long double can be used for better accuracy but i cant implement it and utilize it without a clear understanding. Heres an example for you to go off of. double num = 4.21 THANK YOU AS ALWAYS! i just tested all 3 the only difference i can find is long double gives you a number like -8.3453b+144 but float and double output the same.

13th Apr 2017, 2:56 PM
Seth T
Seth T - avatar
2 Answers
+ 4
float is a 32 bit floating point number (decimal or real number) a long double is just a double you do not have to use long in front of it as it does absolutely nothing. double is a 64 bit floating point number. Remember do not use long in front of double it doesn't do anything.
13th Apr 2017, 5:27 PM
Joshua Pierson
Joshua Pierson - avatar
+ 1
awesome atleast i know now long double is useless af, 1 less thing to remember 😂😂. thanks i guess that clears it up a bit ontop of my current understanding. thanks again joshua 🙄
13th Apr 2017, 5:56 PM
Seth T
Seth T - avatar