Question: How can I use `if`inside int()?

I have following program and get error

>f := (x,y) -> `if`(x>1, x+y, x-y);

>f(1.1,0.1);#function without int evaluated correctly
                                     1.2
>ff := (y) -> int(f(x,y), x=-2.0..2.0);

>evalf(ff(1.2));

Error, (in eval/if) cannot determine if this expression is true or false: 1 < x
 

I need only numeric result. How can I use `if` inside int?

Please Wait...