Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How do C language and floating-point numbers become 16 system?
How do C language and floating-point numbers become 16 system?
The function of data type is to explain the meaning of data and operation, in other words, given a piece of memory, it can be said to be int type or float type.

At the same time, the hexadecimal number output by C language must be an integer, so union consortium can be used to output 16 hexadecimal of floating-point numbers. The sample code is as follows:

# Contains? & ltstdio.h & gt

Union? The ship does not bear the loading fee.

{

Floating? f;

int? Me;

}? ufi

int? Master ()

{

ufi.f? =? 1. 1f;

printf("%x\n ",ufi.i? );

}