## what's the largest number float type can hold?

I'm new to programming and have recently come up with this simple question .
float type has 32 bits in which 8 bits are for the whole number part (digits before decimal point).
so **my question is can float type hold numbers bigger than 255.9999 ?**

and I would also appreciate if someone told me why this code is behaving unexpectedly.is it a related issue?

int main(){ float a=123456789.1; printf("%lf",a); return 0; }

for which the output is :

123456792.000000

**What,** P!nk's official music video for 'So What'. Click to listen to P!nk on Spotify: http:// smarturl.it Duration: 3:46
Posted: Oct 25, 2009 Quickly send and receive WhatsApp messages right from your computer.

The most common 32-bit floating-point format, IEEE-754 *binary32*, does not have eight bits for a base. The base is fixed at two. It has one bit for a sign, eight bits for an exponent field, and 23 bits for a significand field (a fraction part).

The sign bit determines whether the number is positive (0) or negative (1).

The exponent field, e, has several uses. If it is 11111111 (in binary), and the significand field, f, is zero, the floating-point value represents infinity. If e is 11111111, and the significand field is not zero, it represents a special Not-a-Number "value".

If the exponent is not 11111111 and is not zero, floating-point value represents 2e−127•(1+f/223), with the sign added. Note that the fraction portion is formed by adding 1 to the contents of the significand field. That is often called an implicit 1, so the mathematical significand is 24 bits—1 from the leading 1, 23 from the significand field.

If the exponent is zero, floating-point value represents 21−127•(0+f/223), with the sign added. Note that the leading bit is 0. These are called subnormal numbers. They are included in the format to make some mathematical properties work in floating-point arithmetic.

So the largest finite value represented is when the exponent is 11111110 (254) and the fraction is all ones (223−1), so the number represented is 2254−127•(1+ (223−1)/223) = 2127•(1−2−23) = 2127−2104 = 340282346638528859811704183484516925440.

In `float a=123456789.1;`

, the `float`

type does not have enough precision to represent 123456789.1. (In fact, a decimal fraction .1 can never be represented with a binary floating-point format.) When we have only 24 bits for the significand, the closest numbers to 123456789.1 that we can represent are 123456792 and 123456800.

**P!nk - So What (Official Music Video),** I will do what I can to help you. TranslationsEdit. show ▽what? (interrogative pronoun)� what definition: 1. used to ask for information about people or things: 2. used in questions that show you are…. Learn more.

what's the largest number [the] float type can hold?

The C Standard defines:

FLT_MAX

Include `<float.h>`

to have it be `#define`

d.

**what,** What Happened to Daniel Prude? The police released few details in March about the death of a Black man restrained by officers in Rochester,� noun the true nature or identity of something, or the sum of its characteristics: a lecture on the whats and hows of crop rotation.

**What Happened to Daniel Prude?,** Make Gabrielle Hamilton's dish that she learned from her late ex-mother-in-law, in Puglia, Italy. whatever: adverb at all , of any description , of any kind or sort , whatsoever , whichever

**What to Do With All That Zucchini,** what definition: 1. used to ask for information about people or things: 2. used in questions that show you are…. Learn more. The ORIGINAL and OFFICIAL "What What (In the Butt)" video! Samwell will CALL your friends and family! Go here: http://officialsamwell.com/live-call/ This is

**WHAT,** Now he's not sure what species of fish he caught. It could be a channel catfish. WhatsApp Messenger: More than 2 billion people in over 180 countries use WhatsApp to stay in touch with friends and family, anytime and anywhere. WhatsApp is free and offers simple, secure, reliable messaging and calling, available on phones all over the world.

##### Comments

- Yes. Its
*floating*point, not*fixed*point. `float type has 32 bits in which 8 bits are for the whole number part (digits before decimal point)`

its**not**the digits before the decimal point. Its the base.- Well... you really shoud search
`SO`

or`wikipedia`

before asking such questions. - The largest value a floating-point type can represent is infinity.
- See the
`<float.h>`

header of your system. It should include`FLT_MAX`

. As of continuation of your question, floating points tend to be less precise when moving far from zero. - Comments are not for extended discussion; this conversation has been moved to chat.
- your answer helped me with all my confusion about float domain .thanks a million