Here is my code to find the number of values less than or equal to the ‘value’ passed to the function. Please tell me the reason why this code should fail. Any test case would be helpful.

Thanks a lot.

```
public static int search( int a[], int value){
int low=0;
int high=a.length-1;
int ans=0;
while(low<=high)
{
int mid=low+(high-low)/2;
if(a[mid]<=value)
{
ans=mid+1;
low=mid+1;
}
else
{
high=mid-1;
}
}
return ans;
}
```