0

in greedy, some results of calculation are 1.00 or 2.00, etc... the type of the variable are float. I tried to convert them to integer using type casting like n = (int) f where f is the float type variable. the result is very weird since if f=1.00 the result is n=0 (I would expect n=1) if f=2.00 , n=1 instead of 2?

Any idea? thanks

2
-1

Floats are imprecise try anther way to convert it. Their are other ways to do it.

Not the answer you're looking for? Browse other questions tagged .