Tag: C++
All the articles with the tag "C++".
-
Maximum Value of a double in C++ (DBL_MAX Explained)
The max value of a double in C++ is about 1.8e308. Get it with DBL_MAX or numeric_limits, and learn why min() is not the most negative value.
-
How to Compare Floating-Point Numbers in C++ (Why == Fails)
Why 0.1 + 0.2 != 0.3 in C++, and how to compare doubles correctly with an epsilon tolerance. Includes a reusable almostEqual function and when exact == is fine.
-
INT_MAX and INT_MIN in C++: The Maximum and Minimum int Value
The maximum value of an int in C++ is 2147483647 and the minimum is -2147483648. How to get them with INT_MAX, INT_MIN and numeric_limits, plus overflow traps.
-
How to Read Multiple Inputs on One Line in C++
Read several values from one line in C++ with cin, getline and stringstream. Handle unknown counts, comma-separated input, and reading until the user stops.