Re: comparison
On Oct 21, 3:10 pm, ndu...@gmail.com wrote:
> I want to write something like
> status_bit = (unsigned)(i - j) >> 31
>
> as an equivalent code for
signed int i;
signed int j;
> if(i < j){
> {
> status_bit = 1;
>
> }else{
> status_bit = 0;
> }
>
> This actually works for most of the cases but fails for two values
> i = 0x80000000
> j = 0x7fffffff
>
> I want a linear code for the above i.e. without jumps, so
> 1. what could be the issue?
> 2. what could be the solution?
|