The "a > 0" should also be "a > 0.". It does not matter here, but it's better for always being on the safe side.

In a programming language, 0.9 is greater that 0.8, but it is not greater than 0 . When mixing integers and floats one must be very careful, so avoid mixing when possible. The compiler automatically converts different types, and mostly in the way that you want, but sometimes not.