c++ - Conversion from unsigned int to float -


Conversion to 'float' from 'HTC', potential loss of data

  Warning C4244: '=': / code>  

Should not any float be able to handle any value?

  unsigned int: 0 to 4,294,967,295 float 3.4 e +/- 38 (7 digits)  

wiki:

 The advantage of floating-point presentation on  fixed point (and  

integer) is that it can support a much greater range of values.

Any insights will be helpful, thanks.

To store both 'unsigned int' and 'float' values For 32-bit use. Since there is a large range of float, so it sacrifices some precision necessary. This means that there are some unsigned interlaced values ​​which not can appear correctly in a float. Provides some more details.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -