CODE NOT GIVING REQUIRED OUTPUT

Code is giving returning -1 for every input. I am not able to find what wrong i have written in my function binary.

package practise;

public class binarySearch {
public static int binary(int b[],int item)
{
int low=0;
int high=b.length-1;
while(low<=high)
{
int med=low+high/2;
if(b[med]>item)
{
high=low-1;
}
else if(b[med]<item)
{
low=med+1;
}
else
{
return med;
}
}
return -1;
}
public static void main(String[] args) {

int[] a= {5,7,10,12,15,20,27,31,36,42,55,58};
int result=binary(a,27);
System.out.println(result);
}

}

Hey @mayankgrover261
Please use parenthesis when you calculate mid, I guess the problem lies there.
Check if now your code works
Thankyou