The ranges are actually –infinity to +infinity.

The largest finite float is 340282346638528859811704183484516925440. This is 2128–2128–24.

The largest finite double is 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368. This is 21024–21024–53.

Answer from Eric Postpischil on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-float-and-double
C Float and Double - GeeksforGeeks
June 12, 2026 - Stores values ranging from 3.4 × 10⁻³⁸ to 3.4 × 10³⁸. Uses %f format specifier. ... Explanation: The value loses precision after approximately 6–7 decimal digits because a float has limited storage space.
Discussions

float, double and long double ranges ? - C++ Forum
So this isn't particularly useful information because the ranges are enormous, and at the "edges" quantization error is so large as to make manipulating such values difficult. Anyway the range of long double in particular varies between machines. To get it for your computer, run this program: More on cplusplus.com
🌐 cplusplus.com
October 6, 2021
c - Calculate the range of double - Stack Overflow
Then code is re-formed using d ... volatile double product = step_d*last_d; d = last_d + product;) to exercise an alternate method that is more numerically accurate. 2017-08-22T18:09:10.957Z+00:00 ... Cool stuff, I never thought I would see it being used in such context. :) 2017-08-22T18:17:12.167Z+00:00 ... @Vladimir Some details: The core issue here is that when using FP near its limits of precision/range, it is important ... More on stackoverflow.com
🌐 stackoverflow.com
August 23, 2017
c - To print Range of Double - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... Save this question. Show activity on this post. I am a beginner programmer. Using Dev C++ I need to print the range of double, long long int, unsigned long long int, signed long long int, unsigned ... More on stackoverflow.com
🌐 stackoverflow.com
What does it mean in C that data type "Double" is more "expensive" than data type "Float"
Thanks for all the replies! I am on week 1 of CS50 and planning on self-teaching. One thing I want to avoid is assuming things early on. I had a feeling it was going to be more efficient to use float when a double isn't needed, but wasn't certain. Thank you all for clarifying! More on reddit.com
🌐 r/learnprogramming
18
7
December 6, 2021
People also ask

Can double be used to store large numbers in C?
Yes, double is capable of storing large numbers, but it has a finite precision. Numbers beyond its range can result in overflow or underflow.
🌐
upgrad.com
upgrad.com › home › tutorials › software & tech › double in c
Everything You Need to Know About the Double Data Type in C
How do I round a double value to the nearest integer in C?
Use the round() function from the math.h library to round a double to the nearest integer value. For example, double rounded = round(3.6);.
🌐
upgrad.com
upgrad.com › home › tutorials › software & tech › double in c
Everything You Need to Know About the Double Data Type in C
How do you use double for scientific notation in C?
You can represent numbers in scientific notation with double by using the e notation. For example, double value = 1.23e4; represents 1.23 × 10^4.
🌐
upgrad.com
upgrad.com › home › tutorials › software & tech › double in c
Everything You Need to Know About the Double Data Type in C
🌐
Scaler
scaler.com › home › topics › what is double in c?
What is Double in C? - Scaler Topics
April 28, 2024 - The double in c ranges between 1.7E-308 - 1.7E+308.
🌐
W3Resource
w3resource.com › c-programming › c-data-types.php
C Data Types - w3resource
April 8, 2026 - Ranges for integer data types in ...----------------------------------------- flaot 1.175494e-38 3.402823e+38 double 2.225074e-308 1.797693e+308 long double 3.362103e-4932 1.189731e+4932...
🌐
TutorialsPoint
tutorialspoint.com › cprogramming › c_data_types.htm
C - Data Types
The following example prints the storage space taken by a float type and its range values − · #include <stdio.h> #include <stdlib.h> #include <limits.h> #include <float.h> int main(int argc, char** argv) { printf("Storage size for float : %zu \n", sizeof(float)); printf("FLT_MAX : %g\n", (float) FLT_MAX); printf("FLT_MIN : %g\n", (float) FLT_MIN); printf("-FLT_MAX : %g\n", (float) -FLT_MAX); printf("-FLT_MIN : %g\n", (float) -FLT_MIN); printf("DBL_MAX : %g\n", (double) DBL_MAX); printf("DBL_MIN : %g\n", (double) DBL_MIN); printf("-DBL_MAX : %g\n", (double) -DBL_MAX); printf("Precision value: %d\n", FLT_DIG ); return 0; } When you compile and execute the above program, it produces the following result on Linux − ·
🌐
Global Tech Council
globaltechcouncil.org › home › blogs › what is double in c?
What is Double in C? - Global Tech Council
April 22, 2026 - Accuracy: Double data types can ... where even a tiny error can lead to significant changes in results. Range: Doubles have a wider range than floats....
🌐
YouTube
youtube.com › watch
Displaying Float, Double, and Long Double Value Ranges in C Programming - YouTube
In this C Programming Language tutorial, we dive into understanding the range of values that can be represented by different floating-point types: float, dou...
Published: April 7, 2025
Find elsewhere
🌐
Upgrad
upgrad.com › home › tutorials › software & tech › double in c
Everything You Need to Know About the Double Data Type in C
February 27, 2025 - Double in C is used to store real numbers (decimal values) that require more precision and a larger range than regular floating-point numbers.
🌐
Wikipedia
en.wikipedia.org › wiki › C_data_types
C data types - Wikipedia
October 2, 2026 - The C language provides the four ... and double (as well as the Boolean type bool), and the modifiers signed, unsigned, short, and long. The following table lists the permissible combinations in specifying a large set of storage size-specific declarations. ↑ The standard term for the size of an integer type in bits is width. The width does not include padding bits. 1 2 3 4 5 The minimal ranges [−(2n−1−1), ...
🌐
Javatpoint
javatpoint.com › what-is-double-in-c
What is double in C - javatpoint
We are excited to announce that we are moving from JavaTpoint.com to TpointTech.com on 10th Feb 2025. Stay tuned for an enhanced experience with the same great content and even more features. Thank you for your continued support! In C programming language, a string is an array of characters terminated by a null character ('\0').
🌐
BYJUS
byjus.com › gate › size-of-data-types-in-c
Size of Data Types in C
February 16, 2024 - Although the size of any unsigned as well as the signed data type is all the same, they both possess different ranges of values to be stored in any variable. Why? It is because the representation of the signed numbers is in 2’s complement form in any processor or machine. For instance, the representation of the number -23 in the form of 2’s complement would be: (Decimal) 23 <-> (Binary) 10111 ... The C language specifies two of the primary data types for storing the fractional numbers or the floating-point. These are double or float.
🌐
Testbook
testbook.com › home › gate › double data type in c - detailed guide | testbook
Double Data Type in C - Detailed Guide | Testbook
It can accommodate about 15 to 17 digits before or after a decimal point. The range of a double is about 5.0 x 10-345 to 1.7 x 10308. ... Try these exercises for a better understanding of the double data type in C.
🌐
Microsoft Learn
learn.microsoft.com › en-us › cpp › c-language › type-double
Type double | Microsoft Learn
August 3, 2021 - The double type contains 64 bits: 1 for sign, 11 for the exponent, and 52 for the mantissa. Its range is +/-1.7E308 with at least 15 digits of precision.
🌐
Medium
medium.com › @Dev_Frank › datatypes-in-c-double-long-double-void-bool-0e55eaec1380
DATATYPES IN C (double, long double, void, bool) | by Dev Frank | Medium
February 5, 2024 - double numbers can be expressed ... // Equivalent to 0.000123 · double provides double-precision floating-point numbers, offering a larger range and higher precision than the float data type....
🌐
Cplusplus
cplusplus.com › forum › general › 280341
float, double and long double ranges ? - C++ Forum
October 6, 2021 - So this isn't particularly useful information because the ranges are enormous, and at the "edges" quantization error is so large as to make manipulating such values difficult. Anyway the range of long double in particular varies between machines. To get it for your computer, run this program:
🌐
GeeksforGeeks
geeksforgeeks.org › c++ › data-type-ranges-and-their-macros-in-c
Data Type Ranges and Their Macros in C++ - GeeksforGeeks
June 13, 2026 - Example: The following program displays the ranges of several built-in data types using predefined macros ... #include <iostream> // for int, char macros #include <climits> // for float, double macros #include <cfloat> using namespace std; int main() { // Displaying ranges with the help of macros cout << "char ranges from: " << CHAR_MIN << " to " << CHAR_MAX << endl; cout << "\nshort int ranges from: " << SHRT_MIN << " to " << SHRT_MAX << endl; cout << "\nint ranges from: " << INT_MIN << " to " << INT_MAX << endl; cout << "\nlong int ranges from: " << LONG_MIN << " to " << LONG_MAX << endl; cout << "\nfloat ranges from: " << FLT_MIN << " to " << FLT_MAX << endl; return 0; }
🌐
BYJUS
byjus.com › gate › double-data-type-in-c
Why Do We Use Double Data Type in C?
April 25, 2022 - It is very big in size, thus very slow, and it can easily accommodate about 15 to 17 digits after or before a decimal point. The typical range of a double is about 5.0 x 10-345 to 1.7 x 10308.
Top answer
1 of 2
5

OP's approach works when calculations are done with wider precision than float in the first case and wider than double in the 2nd case.

In the first case, OP reports FLT_EVAL_METHOD == 0 so float calculations are done as float and double are done as double. Note that float step ... 1.0 + step is a double calculation.


The below code forces the calculation to double and so I can replicate OP's problem even with my FLT_EVEL_METHOD==2 (Use long double for internal calculations.)

  volatile double d = 1.0;
  volatile double last_d;
  volatile double step_d = 9.0;
  while(1) {
      last_d = d;
      d *= (1.0 + step_d);
      while (d == INFINITY) {
          step_d /= 2.0;
          volatile double sum = 1.0 + step_d;
          d  = last_d * sum;
          //d  = last_d  + step_d*last_d;
      }
      if (! (d > last_d) ) {
        break;
      }
  }

diff                 : 1.995840e+292
The expected value?  : no

Instead OP should use the following which does not form the inexact sum of 1.0 + step_d when step_d is small, rather it forms the exact product of step_d*last_d. The 2nd form results in a more accurate calculation for the new d, by providing an additional bit of calculation precision in d. Higher precision FP is not needed to employ OP's approach.

          d  = last_d  + step_d*last_d;

diff                 : 0x0p+0 0.000000e+00
The expected value?  : yes
2 of 2
1

The expressions with the literals n.0 are all double precision floating point types. That allows the assignment to f to be calculated using a higher precision intermediate value.

It's this effect that allows the algorithm to converge in the float case.

With strict double precision floating point such convergence is not possible.

If you had used the f suffix on the literals in the float case then convergence would not occur there either.

A fix would be to use long double suffixes on the literals if your platform has a wider long double type.

🌐
DaniWeb
daniweb.com › programming › software-development › threads › 75943 › range-of-a-double-integer-in-c
Range of a double integer in C++ | DaniWeb
April 20, 2007 - A bare decimal like 55555557777777770 is parsed as an integer literal and the compiler tries to fit it into int/long/long long; if it doesn’t fit you get the “integer constant is too large” error. To make a floating literal, use a decimal point or exponent (for example 4.294967295e9) or explicit suffixes/casts. As @AncientDragon hinted, forcing a literal to be floating-point fixes that specific compile error, but it does not change floating-point accuracy. Second, even when you do have a double, its range (very large and very small exponents) is different from its precision.