Hi, given a sorted array x, find the last x[i] s.t. rQ < x[i]. I use bisearch. alg itself passes Emu, but Device has error at break.
I’m sure that break is supported in 0.8, so where’s the mistake?Thanks!
//bisearch
low = 0;
high = EleNum;
probe = low + (high - low) / 2;
while(low < high)
{
if(x[probe] > rQ)
{
high = probe - 1;
}
else
{
low = probe + 1;
if(c_x[low] > rQ)
{
break;//passes if i comment this break
}
}
probe = low + ((high - low) / 2);
}
result = probe;