+ 2

# C++ float, double and long double

can someone explain float double and long double in simple terms so I can understand

2 Answers

+ 19

FloatsÂ have less precision than doubles. ... typeÂ float, 32 bits long, has a precision of 7 digits. While it may store values with very large or very small range (+/- 3.4 * 10^38 or * 10^-38), it has only 7 significant digits. typeÂ double, 64 bits long, has a bigger range ( *10^+/-308) and 15 digits precision.
And if you're still in doubt, you can code and check it out :)

+ 3

long , short , signed are called datatype modifier.
we know that int , float , double..... have certain limits of value.
by adding these modifier on front of data types we change the limit ( decrease / increase).
learn more:
https://www.tutorialspoint.com/cplusplus/cpp_modifier_types.htm