double and float variables
-
I can't use double and float variables correctly. When I appoint a float or double values to float or double variables, The variables have 0.0 or 1.0 values. they don't have another values.(for example 0.152 or 0.53 :eek:...) I don't solve this. or is there another usage float and double variables? I haven't known deniz
-
I can't use double and float variables correctly. When I appoint a float or double values to float or double variables, The variables have 0.0 or 1.0 values. they don't have another values.(for example 0.152 or 0.53 :eek:...) I don't solve this. or is there another usage float and double variables? I haven't known deniz
deniz79s wrote: or is there another usage float and double variables? I haven't known No! double d = 0.0; double d = 1.0; double d = 0.152; double d = 123.456; float f = 0.0; float f = 1.0; float f = 0.152; float f = 123.456; should all produce the correct results. Now if you wher trying to do something like "if( d == 1.0 )" you may be having a problem (don't do that!). INTP