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
🌐
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.

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
🌐
Wikipedia
en.wikipedia.org › wiki › Single-precision_floating-point_format
Single-precision floating-point format - Wikipedia
3 weeks ago - Before the widespread adoption of IEEE 754-1985, the representation and properties of floating-point data types depended on the computer manufacturer and computer model, and upon decisions made by programming-language designers. E.g., GW-BASIC's single-precision data type was the 32-bit MBF floating-point format. Single precision is termed REAL(4) or REAL*4 in Fortran; SINGLE-FLOAT in Common Lisp; float binary(p) with p≤21, float decimal(p) with the maximum value of p depending on whether the DFP (IEEE 754 DFP) attribute applies, in PL/I; float in C with IEEE 754 support, C++ (if it is in C), C# and Java; Float in Haskell and Swift; and Single in Object Pascal (Delphi), Visual Basic, and MATLAB.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-float-and-double
C Float and Double - GeeksforGeeks
July 23, 2025 - It is the greater version of float which can store real numbers with precision up to 15 decimal places. The size of the double is 8 bytes. The range of double is 1.7x10-308 to 1.7x10+308.
🌐
Quora
quora.com › What-are-the-exact-minimum-and-maximum-range-of-float-double-and-long-double-data-type-in-C
What are the exact minimum and maximum range of float, double, and long double data type in C? - Quora
Answer (1 of 3): > What are the exact minimum and maximum range of float, double, and long double data type in C? The ranges can vary from one implementation to another. The ISO C standard imposes minimal values for the bounds of the floating-point types (and the integer types), but implementati...
🌐
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 ...
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.

Find elsewhere
🌐
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....
🌐
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.
🌐
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; }Code language: C++ (cpp)
🌐
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 ...
🌐
W3Resource
w3resource.com › c-programming › c-data-types.php
C Data Types - w3resource
August 19, 2022 - 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...
🌐
W3Schools
w3schools.com › c › ref_keyword_float.php
C float Keyword
C Examples C Real-Life Examples C Exercises C Quiz C Code Challenges C Compiler C Syllabus C Study Plan C Interview Q&A C Certificate ... The float keyword is a data type which stores fractional numbers.
🌐
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....
🌐
Mbed
os.mbed.com › handbook › C-Data-Types
C Data Types - Handbook | Mbed
Whilst most types are signed by default (short, int, long long), char is unsigned by default. Because the natural data-size for an ARM processor is 32-bits, it is much more preferable to use int as a variable than short; the processor may actually have to use more instructions to do a calculation on a short than an int!
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
Top answer
1 of 2
9

Floating point numbers are stored as an exponent and a fraction within the space available.

For some systems where float is implemented as an IEEE 754 value, the results would looks as below.

sign : 1 bit
exponent : 8 bits
fraction : 23 bits

The exponent allows numbers from 2 ^ (-127) (2 to the power -127) to 2 ^ 128 ( 2 to the power 128).

Allowing a range of numbers from

5.87747E-39 3.40282E+38

the fraction point gives a fraction such as .12313

Thus with 23 bits of values, the accuracy of a number is about 7 decimal digits or 1.19 E-7

For more details see wikipedia : IEEE 754-1985

On a given system, the <cfloat> / <float.h> will give the limits. For non IEEE 754 based representations, you would have to understand how the numbers are stored to calculate the limits.

2 of 2
0

-2^(n-1) to (2^(n-1)-1) is the formula to calculate the range of data types.

Where n = no.of.bits of the primitive data type.

For example: for the byte data type, n = 8 bits -2^(8-1) to (2^(8-1)-1) The above calculation will give you -128 to 127. Now, coming to the question of why it’s not 255. The reason is that byte, int, short, and double are signed data types meaning it has half the range below 0 (negative) and half the range above 0 (positive). The first bit represents a sign (+ or -). The remaining bits are 7. That’s why 2^(8-1) = 128. We take 0 as a positive sign, so the range is 2^(8-1) - 1 for positive numbers. Floating point numbers are stored as an exponent and a fraction within the space available.

🌐
CodeRivers
coderivers.org › c › c-basic › c-float
Demystifying C `float`: Fundamental Concepts, Usage, and Best Practices - CodeRivers
January 19, 2025 - A float can typically represent approximately 6 - 7 significant decimal digits. The range of a float is from approximately $1.2 \times 10^{-38}$ to $3.4 \times 10^{38}$. Values outside this range will result in underflow or overflow, which can lead to incorrect results or program crashes.