Joe123
11-21-2007, 05:55 PM
I don't really understand how int and float work completely.
From what I understand, int, short for integer, should store a numerical value which is truncated to an integer, so no decimal places are held. And float simmilarily stores a numerical value, but also stores decimal places.
But this can't be true, because in std.zh it clearly says 'const int PI = 3.14'.
I'm assuming const is constant, but 3.14 is still not an integer.
And I've also saved divisions of numbers for FFC speeds which surely should have at least some decimal places as int values, which seem to work fine also.
Could someone explain this to me please?
From what I understand, int, short for integer, should store a numerical value which is truncated to an integer, so no decimal places are held. And float simmilarily stores a numerical value, but also stores decimal places.
But this can't be true, because in std.zh it clearly says 'const int PI = 3.14'.
I'm assuming const is constant, but 3.14 is still not an integer.
And I've also saved divisions of numbers for FFC speeds which surely should have at least some decimal places as int values, which seem to work fine also.
Could someone explain this to me please?