Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a joke. For those who didn't get the joke:

1. ~ and - are separate operators. - negates, ~ does this: http://stackoverflow.com/a/7207406

2. Integers on computers are typically represented in two's complement notation: http://www.cs.cornell.edu/~tomf/notes/cps104/twoscomp.html

3. Now that we know how all the parts work, we can put them together step by step:

    ~-0010 => ~1110 => 0001
    -~0010 => -1101 => 0011


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: