A 32 bit floating point number has 23 + 1 bits of mantissa and an 8 bit exponent (-126 to 127 is used though) so the largest number you can represent is:

(1 + 1 / 2 + ... 1 / (2 ^ 23)) * (2 ^ 127) = 
(2 ^ 23 + 2 ^ 23 + .... 1) * (2 ^ (127 - 23)) = 
(2 ^ 24 - 1) * (2 ^ 104) ~= 3.4e38
Answer from Andreas Brinck 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

floating point - Calculating range of float in C - Stack Overflow
Title pretty much sums it all. I know that floats are 32bit total with 23bits for mantissa and 8bits for the exponent value and 1 for signing. Calculating the range of "int" is pretty simple: 3... More on stackoverflow.com
🌐 stackoverflow.com
float vs. double – What's the Key Difference?"
C and C++ will give you more ways ... these considerations aren't necessarily limited to those languages. ... The difference is memory size. Floats in Java (which I assume is the language you’re talking about) take up 32 bits of memory, the same as an integer. Doubles, as you might guess from the name, take up double the space: 64 bits. Doubles use those extra bits to both store a wider range of numbers ... More on reddit.com
🌐 r/learnprogramming
12
16
November 2, 2024
Is it ok to do "if (x == 1)" or "if (x == 0)" when x is a float?
I want to add a tiny bit of nuance to the typical "no" answer. If, and this is a big if, x is always assigned from some set of known values, then equality testing from those set of values is going to be OK. E.g. maybe x is the gravitational constant and you have definitions like: double kGravitationalConstantEarth = 9.8; double kGravitationalConstantJupiter = 24.79; ... If you know that x is always going to be one of these values, equality testing will work. If x can be set to an arbitrary value, then it's a different story. Someone might be trying to set it to 0 or to 1, but if they arrive at 0 or 1 by some computation then they might compute a value really close to 0 or 1, but not spot-on - meaning your equality test will fail. The fact that 1 or 0 can be represented exactly doesn't save you. In fact, it's kind of irrelevant. This real issue is if you have no way of knowing how the value was computed you cannot assume it's the precise value you're expecting. More on reddit.com
🌐 r/C_Programming
64
62
December 24, 2023
float - range of values and precision
Range of values means all the numbers you can represent with a given type (usually this is expressed simply by stating the lowest and highest possible values). Precision is how accurately a number can be expressed. For example, sqrt(2) is an irrational number, which means it is infinite in significant digits. But we can only represent a certain amount of those digits with the finite size of a floating point number before we either run out of digits or are no longer able to accurately store those digits. You may see precision errors when trying to calculate something as simple as 0.1 + 0.2 due to floating point precision issues. More on reddit.com
🌐 r/learnprogramming
4
0
July 6, 2021
People also ask

Why do we use the floating data types?
The C language specifies two of the primary data types for storing the fractional numbers or the floating-point. These are double or float. One can easily apply the long qualifiers on the double. Thus, we get another type, which is the long double. · In a computer system, the IEEE-754 format represents the floating-point numbers. A majority of modern processors and processors adopt this format. It has two major representations: · 1. 32-bit single precision · 2. 64-bit double precision
🌐
byjus.com
byjus.com › gate › size-of-data-types-in-c
Size of Data Types in C
What differentiates the range for unsigned and signed types?
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
🌐
byjus.com
byjus.com › gate › size-of-data-types-in-c
Size of Data Types in C
🌐
Microsoft Learn
learn.microsoft.com › en-us › cpp › c-language › type-float
Type float | Microsoft Learn
The mantissa represents a number between 1.0 and 2.0. Since the high-order bit of the mantissa is always 1, it is not stored in the number. This representation gives a range of approximately 3.4E-38 to 3.4E+38 for type float.
🌐
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
Top answer
1 of 2
1

C does not define float as described by OP. The one suggested by OP: binary32, the most popular, is one of many conforming formats.

What C does define

5.2.4.2.2 Characteristics of floating types

s sign (±1)
b base or radix of exponent representation (an integer > 1)
e exponent (an integer between a minimum emin and a maximum emax)
p precision (the number of base-b digits in the significand)
fk nonnegative integers less than b (the significand digits)

x = s*power(b,e)*Σ(k=1, p, f[k]*power(b,-k))

For binary32, the max value is

x = (+1)*power(2, 128)*(0.1111111111 1111111111 1111 binary)

x = 3.402...e+38

Given 32-bits to define a float many other possibilities occur. Example: A float could exist just like binary32, yet not support infinity/not-a-number. The leaves another exponent available numbers. The max value is then 2*3.402...e+38.


binary32 describes its significand ranging up to 1.11111... binary. The C characteristic formula above ranges up to 0.111111...

2 of 2
0

C uses single-precision floating point notation, which means that a 32-bit float has 1 bit for the sign, 8 bits for the exponent, and 23 bits for the mantissa. The mantissa is calculated by summing each mantissa bit * 2^(- (bit_index)). The exponent is calculated by converting the 8 bit binary number to a decimal and subtracting 127 (thus you can have negative exponents as well), and the sign bit indicates whether or not is negative. The formula is thus:

(-1)^S * 1.M * 2^(E - 127)

Where S is the sign, M is the mantissa, and E is the exponent. See https://en.wikipedia.org/wiki/Single-precision_floating-point_format for a better mathematical explanation.

To explicitly answer your question, that means for a 32 bit float, the largest value is (-1)^0 * 1.99999988079071044921875 * 2^128, which is 6.8056469327705771962340836696903385088 × 10^38 according to Wolfram. The smallest value is the negative of that.

🌐
Yale University
cs.yale.edu › homes › aspnes › pinewiki › C(2f)FloatingPoint.html
C/FloatingPoint
Operations that would create a ... 64-bit double, the size of both the exponent and mantissa are larger; this gives a range from 1.7976931348623157e+308 to 2.2250738585072014e-308, with similar behavior on underflow and overflow....
Find elsewhere
🌐
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.
🌐
Substack
alexanderobregon.substack.com › alexander obregon's substack › floating point math in c for beginners
Floating Point Math in C for Beginners
February 14, 2026 - The language standard talks about minimum ranges and digit counts through macros in <float.h>, and most common platforms follow the IEEE 754 formats for those types.
🌐
Learn C
learnc.net › home › learn c programming › c float
C Float Types
April 13, 2025 - This header file defines macros such as FLT_MIN , FLT_MAX and FLT_DIG that store the float value ranges and precision of the float types. The float.h also defines macros for double and long double with the prefixes DBL_ and LDBL_. The following program illustrates your system’s storage size and precision of floating-point numbers. #include <stdio.h> #include <float.h> int main( ) { printf("Storage size: %d bytes\n" "Minimum float value: %E\n" "Maximum float value: %E\n" "Precision: %d decimal digits\n", sizeof(float), FLT_MIN, FLT_MAX, FLT_DIG); puts("\nExample of float precision:\n"); double d = 12345.6; float f = (float)d; printf("The floating-point number d 18.10f\n", d); printf("Stored in a variable f of type float as the value .10f\n", f); return 0; }Copy
🌐
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...
🌐
Medium
medium.com › @Dev_Frank › datatypes-in-c-int-char-float-def790690c42
DATATYPES IN C (int, char, float) | by Dev Frank | Medium
February 5, 2024 - Here are the key characteristics ... may vary depending on the compiler and platform. The range of a floating number is -3.4e38 to 3.4e38....
🌐
DataFlair
data-flair.training › blogs › float-data-type-in-c
Float Data Type in C - DataFlair
September 15, 2023 - Let’s break down the main features ... for most applications. Range: They possess the capability to accommodate an extensive spectrum of values, spanning both the diminutive and the substantial....
Top answer
1 of 1
3

See Single-precision floating-point format for a details about a typical C float.

Range of magnitude for float in c programming language?

#include <float.h>
printf("float magnitude range %e to %e\n", FLT_MIN, FLT_MAX);
// typical result
// float magnitude range 1.175494e-38 to 3.402823e+38

How is that possible since we have only 32-bits?

Typical float does indeed only store about 232 different values. Yet they are not distributed linearly but logarithmically in linear groups.

223 different values in the range [2-126 to 2-127)
...
223 different values in the range [0.5 to 1.0)
223 different values in the range [1.0 to 2.0)
223 different values in the range [2.0 to 4.0)
...
223 different values in the range [2127 to 2128)

And their negative counter parts.
Also +/- zeros, small sub-normal numbers, +/- infinity and Not-a-Number

It also has to keep track of the sign , so how is it storing all this in just 32-bits?

 1 bit for sign
 8 bits for the binary exponent
23 bits for the significant (with a MSBit usually implied as 1)
--
32 bits

When printing a float, only about 6 or so (FLT_DIG, FLT_DECIMAL_DIG) significant digits usually are important.

printf("%.*e\n", FLT_DIG-1, FLT_TRUE_MIN);
printf("%.*e\n", FLT_DIG-1, FLT_MIN);
printf("%.*e\n", FLT_DIG-1, acos(-1));
printf("%.*e\n", FLT_DECIMAL_DIG - 1, nextafterf(FLT_MAX, 0.0));
printf("%.*e\n", FLT_DECIMAL_DIG - 1, FLT_MAX);

Output

1.40130e-45    // min sub-normal
1.17549e-38    // min normal
3.14159e+00    // pi
3.40282326e+38 // number before max
3.40282347e+38 // max
🌐
TutorialsPoint
tutorialspoint.com › cprogramming › c_data_types.htm
C - Data Types
CHAR_BIT : 8 CHAR_MAX : 127 CHAR_MIN : -128 INT_MAX : 2147483647 INT_MIN : -2147483648 LONG_MAX : 9223372036854775807 LONG_MIN : -9223372036854775808 SCHAR_MAX : 127 SCHAR_MIN : -128 SHRT_MAX : 32767 SHRT_MIN : -32768 UCHAR_MAX : 255 UINT_MAX ...
🌐
NxtWave
ccbp.in › blog › articles › float-in-c
Float in C Programming | Definition, Syntax & Examples
These are useful for representing fractional values in calculations. The float type takes up 4 bytes (32 bits) of memory and can store values in the approximate range of 1.2E-38 to 3.4E+38, with a precision of about 6 decimal places.
🌐
Quora
quora.com › How-do-we-find-the-range-of-a-float-in-C
How do we find the range of a float in C++? - Quora
Answer (1 of 2): This isn’t really a question about C++, as practically all modern languages implement IEEE rules for standard types (int, double, float, long etc). And these IEEE rules define the minimum and maximum values of a float to be minus infinity and plus infinity respectively. What do...
🌐
Quora
quora.com › What-is-the-range-of-float-and-double-data-type
What is the range of float and double data type? - Quora
Answer (1 of 7): The ranges of values for these data types vary, depending on the compiler implementation, so you would need to check your documentation for a definitive answer in your environment. The sizes of (i.e., number of bytes occupied by) the three floating-point data types: * float *...
🌐
Sololearn
sololearn.com › en › Discuss › 1128773 › how-to-calculate-the-range-of-float-and-double-in-c
How to calculate the range of float and double in c | Sololearn: Learn to code for FREE!
You can use the 'sizeof' macro to get the size in bytes. ex: printf("%i bytes\n", sizeof(double)); I'm not quite sure how you'd get the range considering weather they are signed/unsigned and being floating point types so I did some searching ...
🌐
Programiz
programiz.com › c-programming › c-data-types
C Data Types
Here variables a and b can store integer values. And, c can store a floating-point number. If you are sure, only a small integer ([−32,767, +32,767] range) will be used, you can use short.
🌐
freeCodeCamp
freecodecamp.org › news › data-types-in-c-integer-floating-point-and-void-explained
Data Types in C - Integer, Floating Point, and Void Explained
February 1, 2020 - It’s capable of storing at least −9,223,372,036,854,775,807 to 9,223,372,036,854,775,807. Alternatively, get even more overkill with unsigned long long, which will give you at least 0 to 18,446,744,073,709,551,615. float takes at least 32 bits to store, but gives us 6 decimal places from 1.2E-38 to 3.4E+38....