DBL_MAX is defined in <float.h>. Its availability in <limits.h> on unix is what is marked as "(LEGACY)".
(linking to the unix standard even though you have no unix tag since that's probably where you found the "LEGACY" notation, but much of what is shown there for float.h is also in the C standard back to C89)
Answer from Random832 on Stack OverflowDBL_MAX is defined in <float.h>. Its availability in <limits.h> on unix is what is marked as "(LEGACY)".
(linking to the unix standard even though you have no unix tag since that's probably where you found the "LEGACY" notation, but much of what is shown there for float.h is also in the C standard back to C89)
You get the integer limits in <limits.h> or <climits>. Floating point characteristics are defined in <float.h> for C. In C++, the preferred version is usually std::numeric_limits<double>::max() (for which you #include <limits>).
As to your original question, if you want a larger integer type than long, you should probably consider long long. This isn't officially included in C++98 or C++03, but is part of C99 and C++11, so all reasonably current compilers support it.
confused about the max limit we can store for float and double
float and double - C++ Forum
max value for DOUBLE ? - GameDev.net Forums
Why don't float/double have a max & min value like 'int' or 'char'?
Just started learning C. so forigve me if this is a dumb question.
For int and long, the maximum number we can assign them is 2^32 and 2^64 respectively. how about for float and double? I know that double has higher precision of about 15 decimal points while float is 7.
i also know that float is 32 bit while double is 64 bit. So does that mean the highest we can store them (2^32)and (2^64) but with decimal points in between their numbers? i aslo learnt that these data type cant have unsigned value so does that value doubles?
source: https://www.tutorialspoint.com/cplusplus/cpp_data_types.htm#
There's no data shown for the limits floats and doubles have.
However, 'int' is -2147483648 to 2147483647 and 'char' is 0 to 255