Replaced x==int(x) by isinteger and x==0.5*one(x) by x==one(x)/2