That normal in all implicit casting language..

(Number <> 0) , number will be casted to integer, and compared with integer 0 , that's why it gives the result you don't expect. You are comparing a number with an integer..

(Number <> 0.0) , both operands are number now, no implicity casting.

You always have to think and care in advance about implicity casting mechanism. Each language has their standards and behaviors.

Safer is perform the casting by your self,, and make a safer expression like Michael said.

I had same problem like this with DB2 , in a query..

I noticed that it was spending too much time to perform a join operation.. So, after some analysis found out that the "Idiot" here, created different column types.

One Decimal (10.0) in parent table, and INTEGER in child table.

So, When joined Parent.Code = Child.Code , inside db2 engine it was converting all DECIMAL values to INTEGER to perform the proper join.

Implicit casting is useful, but it may bite you..