warning C4244: '=' : conversion from 'unsigned int' to 'float', possible loss of data
Should a float be able to handle any value from int?
unsigned int: 0 to 4,294,967,295 float 3.4E +/- 38 (7 digits)
Wiki:
The advantage of floating-point representation over fixed-point (and integer) is that it can support a much wider range of values.
The advantage of floating-point representation over fixed-point (and
integer) is that it can support a much wider range of values.
Any insight would be helpful, thanks.
http://msdn.microsoft.com/en-us/library/s3f49ktz%28VS.80%29.aspx
'unsigned int' 'float' 32 . , . , unsigned int, . MSDN .
float , unsigned int, . 23- , , , 7 . unsigned ints 9 .
float
unsigned int
: double, float.
double
Edit: , ; . Single.MaxValue? Single.NegativeInfinity? , float int.
Single.MaxValue
Single.NegativeInfinity
int
, float 7 , 10 INT_MAX. , C4244 .
wikipedia:
, "float" C, "" "" 4? Fortran. , 32 (4 ), 24 ( 7 ).
int 32 () , 32 ( ), int, .
,
float f = 0.0f; while (f < (INT_MAX-1)) f++;
, , int 32 .
, , f , f == f + 1