Make sure "n" is declared as int. If it's a float, then there will still be an implicit conversion. In your example you are assigning n to itself, which I don't believe will work (n will be implicitly converted to whatever it is). You should use two variables if they need to be different types.