197 views
1 votes
1 votes

What is the following function doing?
 

unsigned fun(unsigned a, unsigned b)
{
    int i;
    unsigned j = 0;
    for(i = 0; i < 32; i++)
    {
        j <<= 1;
        j += !!(a & 0x80000000);
        a <<= 1;
        if(j >=b)
        {
            j -= b;
            a++;
        }
    }
    return a;
}

 

1 Answer

No related questions found