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 Overflow
🌐
DaniWeb
daniweb.com › programming › software-development › threads › 463134 › what-is-the-max-value-of-a-double
c++ - What is the Max value of a double? [SOLVED] | DaniWeb
September 13, 2013 - All I did in that code was replace a line of code by an abstract function call, it was just to make you think about it at an abstract level, instead of … — mike_2000_17 2,669 Jump to Post ... I think it is 1.79769e+308. ... If you then output a statement for this limit for type double, it should give the number I gave up top. ... It tells me not to use short.MaxValue so I assumed that numeric_limits::max will do the same as this?
Discussions

confused about the max limit we can store for float and double
Interestingly, a double can exactly represent any integer up to about 2^53. Here's more info on the max limits: https://en.wikipedia.org/wiki/IEEE_754 More on reddit.com
🌐 r/C_Programming
8
3
February 1, 2024
float and double - C++ Forum
I understood that integer can have numbers from 0 to 65536. but didn't understand the limitations of the float and double. ... Minimum value for a float is 1.175494351 E – 38 (if you're not familiar with "E" it means "*10^"). Max float is 3.402823466 E + 38. More on cplusplus.com
🌐 cplusplus.com
October 31, 2012
max value for DOUBLE ? - GameDev.net Forums
I have searched the web a bit but cant seem to find where in the standard set of libraries to find a declaration for the max value for the double primitive data type. I have also searched the library myself and cant find it ... it must be there right? More on gamedev.net
🌐 gamedev.net
May 10, 2006
Why don't float/double have a max & min value like 'int' or 'char'?
Dont use tutorials point. Its bad: reason www.learncpp.com is the best free tutorial out there. It covers everything from the absolute basics to advanced topics. It follows modern and best practice guidelines. www.cppreference.com is the best language reference out there. Stay away from cplusplus.com ( reason ), w3schools ( reason ), geeks-for-geeks ( reason ) Programiz( reason ) Tutorialspoint (), educba.com ( reason ) and thinkcpp ( reason ) Most youtube tutorials are of low quality, I would recommend to stay away from them as well. A notable exception are the CppCon Back to Basics videos. They are good, topic oriented and in depth explanations. However, they assume that you have some knowledge languages basic features and syntax and as such arent a good entry point into the language. As a tutorial www.learncpp.com is just better than any other resource. Written by u/IyeOnline . This may get updates over time if something changes or I write more scathing reviews of other tutorials :) . Feel free to copy this macro, but please copy it with this footer and the link to the original. https://www.reddit.com/user/IyeOnline/comments/10a34s2/the_c_learning_suggestion_macro/ More on reddit.com
🌐 r/cpp_questions
12
8
July 17, 2023
🌐
cppreference.com
en.cppreference.com › cpp › types › numeric_limits › max
std::numeric_limits<T>::max - cppreference.com
bool: 1 = 0x1 short: 32767 = 0x7fff int: 2147483647 = 0x7fffffff long: 9223372036854775807 = 0x7fffffffffffffff unsigned long: 18446744073709551615 = 0xffffffffffffffff char: 127 = 0x7f char16_t: 65535 = 0xffff wchar_t: 2147483647 = 0x7fffffff float: 3.40282e+38 = 0x1.fffffep+127 double: 1.79769e+308 = 0x1.fffffffffffffp+1023 long double: 1.18973e+4932 = 0xf.fffffffffffffffp+16380
🌐
GeeksforGeeks
geeksforgeeks.org › c++ › stdnumeric_limitsmax-and-stdnumeric_limitsmin-in-c
std::numeric_limits::max() and std::numeric_limits::min() in C++ - GeeksforGeeks
July 23, 2025 - // C++ program to illustrate the // function numeric_limits<T>::max #include <iostream> #include <limits> using namespace std; // Driver Code int main() { cout << "bool: " << numeric_limits<bool>::max() << '\n'; // It returns 127 in ASCII value // to print in integer that can // be typecast it to int() cout << "char: " << int(numeric_limits<char>::max()) << '\n'; cout << "unsigned char: " << int(numeric_limits<unsigned char>::max()) << '\n'; cout << "short: " << numeric_limits<short>::max() << '\n'; cout << "int: " << numeric_limits<int>::max() << '\n'; cout << "unsigned int: " << numeric_limits<unsigned int>::max() << '\n'; cout << "long long: " << numeric_limits<long long>::max() << '\n'; cout << "float: " << numeric_limits<float>::max() << '\n'; cout << "double: " << numeric_limits<double>::max() << '\n'; cout << "size_t: " << numeric_limits<size_t>::max() << '\n'; }
🌐
O'Reilly
oreilly.com › library › view › c-cookbook › 0596007612 › ch03s08.html
3.7. Getting the Minimum and Maximum Values for a Numeric Type - C++ Cookbook [Book]
November 8, 2005 - You need to know the largest or smallest representable value for your platform for a numeric type, such as an int or double. Use the numeric_limits class template in the <limits> header to get, among other things, the largest and smallest possible values for a numeric type (see Example 3-9). Example 3-9. Getting numeric limits · #include <iostream> #include <limits> using namespace std; template<typename T> void showMinMax() { cout << "min: " << numeric_limits<T>::min() << endl; cout << "max: " << numeric_limits<T>::max() << endl; cout << endl; } int main() { cout << "short:" << endl; showMin
Authors: D. Ryan StephensChristopher DigginsJonathan TurkanisJeff Cogswell
Published: 2005
Pages: 594
🌐
Reddit
reddit.com › r/c_programming › confused about the max limit we can store for float and double
r/C_Programming on Reddit: confused about the max limit we can store for float and double
February 1, 2024 -

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?

🌐
Quora
quora.com › What-are-the-maximum-and-minimum-value-of-double-float-variables-in-C
What are the maximum and minimum value of double float variables in C++? - Quora
Answer: In C++ you can find the answer to your question n the header files. Some of the limits are dependent on implementation which means the standard doesn’t say what the values are. You have to look them up ni a header file: climits for integral types cfloat for floating point types. https:...
Find elsewhere
🌐
Cplusplus
cplusplus.com › forum › beginner › 83526
float and double - C++ Forum
October 31, 2012 - Min double is 2.2250738585072014 E – 308 and max double is 1.7976931348623158 E + 308. If you're not understanding these limitations, keep in mind that the computer is storing them in binary. The number and all the decimal places take up a certain amount of memory in binary.
🌐
The C Book
publications.gbdirect.co.uk › c_book › chapter9 › limits.html
The C Book — Limits
Table 9.1 gives the names declared, the allowable values, and a comment on what they mean. For example, the description of SHRT_MIN shows that in a given implementation the value must be less than or equal to −32767: this means that for maximum portability a program cannot rely on short variables being able to hold values more negative than −32767.
🌐
GameDev.net
gamedev.net › home › forums › for beginners › max value for double ?
max value for DOUBLE ? - GameDev.net Forums
May 10, 2006 - I believe what you are looking for is this. It lists the minimum and maximum values a double can hold in C++ as -1.7*10^308 and 1.7*10^308, respectively.
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › system.double.maxvalue
Double.MaxValue Field (System) | Microsoft Learn
... Some information relates to ... express or implied, with respect to the information provided here. Represents the largest possible value of a Double....
🌐
Cplusplus
cplusplus.com › reference › limits › numeric_limits
std::numeric_limits
Provides information about the properties of arithmetic types (either integral or floating-point) in the specific platform for which the library compiles. This class template is specialized for every fundamental arithmetic type, with its members describing the properties of type T. This template ...
🌐
Cplusplus
cplusplus.com › reference › cmath › fmax
Cplusplus
double fmax (double x , double y); float fmaxf (float x , float y);long double fmaxl (long double x, long double y);
🌐
Reddit
reddit.com › r/cpp_questions › why don't float/double have a max & min value like 'int' or 'char'?
r/cpp_questions on Reddit: Why don't float/double have a max & min value like 'int' or 'char'?
July 17, 2023 -

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

🌐
Wikipedia
en.wikipedia.org › wiki › Long_double
long double - Wikipedia
1 month ago - In C and related programming languages, long double refers to a floating-point data type that is often more precise than double precision though the language standard only requires it to be at least as precise as double.
🌐
Simplilearn
simplilearn.com › home › resources › software development › double data type in c++ | a comprehensive guide
Double Data Type in C++ | A Comprehensive Guide
September 7, 2025 - The C++ double data type falls under the primitive data types category. Learn how does double data type work in C++ and the rules and regulations for using it.
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
GitHub
github.com › dawsonjon › verilog-math › blob › master › components › reference_tests › double_max.c
verilog-math/components/reference_tests/double_max.c at master · dawsonjon/verilog-math
infa = fopen("stim/double_max_a", "r"); infb = fopen("stim/double_max_b", "r"); outf = fopen("stim/double_max_z_expected", "w"); · while(1){ if(fscanf(infa, "%llu", &a) == EOF) break; if(fscanf(infb, "%llu", &b) == EOF) break; f = *(double*)&a >= *(double*)&b ?
Author: dawsonjon
🌐
Cmu
jitsi.cmu.edu.jm › home › c++: double max value trick & pitfalls
C++: Double Max Value Trick & Pitfalls
March 16, 2025 - The largest representable positive ... standard and implemented in C++, represents an upper limit on the magnitude of values that can be stored in this data type without resulting in overflow....
🌐
Xojo Programming Forum
forum.xojo.com › general
Maximum value of a double - General - Xojo Programming Forum
May 4, 2021 - According to the LR the maximum value of a double is: Numerical limits The maximum value of a Double is: ±1.79769313486231570814527423731704357e+308 The minimum value towards zero is: ±4.94065645841246544176568792868…