Filter function handles non-integer x values