You are viewing a single comment's thread. Return to all comments →
Simple solution in java
private static long complement(long num){ return maxInt - num; }
Where long maxInt=(long)Math.pow(2, 32)-1;
Seems like cookies are disabled on this browser, please enable them to open this website
Flipping bits
You are viewing a single comment's thread. Return to all comments →
Simple solution in java
Where long maxInt=(long)Math.pow(2, 32)-1;