|
Re: Converting floating point to integers
Quote:
|
Originally Posted by logicalhippo
float f = 245.56;
int i;
i = (int)f;
printf("%d\n", i);
the output will be 0.
|
That code works fine for me. There's something else at work here.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
|