Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - The maximum value of writing and outputting in C language is double.
The maximum value of writing and outputting in C language is double.
First you know that double is 8 bytes, and then you need to know the memory storage structure of double.

The lower 52 digits are the base number, and all of them are filled in here as 1.

1 1 bit is the index, and the 1 1 bit index can represent-1024~ 1023, which specifies that all bits are added with 1023, so the index here is filled with 2046 bits.

Most significant bit is a symbol, and 0 means+.

The test code is as follows:

# Contains? & ltstdio.h & gt? //For? Print function

# Contains? & ltstring.h & gt// For? memcpy

# Definition? MAX_BASE? (0xfffffffffffffLL)? //52? Bit? basis

# Definition? MAX_POW? (2046LL? & lt& lt? 52) // 12? Bit? Pow (base? *? 2^pow)

# Definition? SIGN_BIT? (0x 1LL? & lt& lt? 63)

Invalid? PrintBits (long? Dragon? ll)

{

Dragon? Dragon? Mask? =? 1;

for(int? i=sizeof(long? Dragon) *? 8? -? 1; ? I & gt=0; ? I-)

{

printf("% 1d ",(ll? & amp? Mask? & lt& lt? Me)? 1:? 0);

}

printf(" \ n ");

}

int? Master ()

{

Dragon? Dragon? ll? =? 0;

ll? |=? MAX _ POW

ll? |=? MAX _ BASE

print bits(ll);

Double? d;

memcpy(& amp; d,? & ampll,? sizeof(ll));

printf("Max? Double? Is:? %e\n ",d);

ll? |=? SIGN _ BIT

memcpy(& amp; d,? & ampll,? sizeof(ll));

printf("Min? Double? Is:? %e\n ",d);

Return? 0;

}