Weblog

Exemple

My article

nice article

* no if
* much panache


# sdfsdf ...
int v;           // we want to find the absolute                        
    value of v
    unsigned int r;  // the result goes here 
    int const mask = v >> sizeof(int) * 
    CHAR_BIT - 1;

r = (v + mask) ^ mask;
Patented variation:
r = (v ^ mask) - mask;

Add comment

April 19, 2017, 1:05 p.m. by superlel

C'est super

logout