Two's complement: Difference between revisions
Content added Content deleted
m (Made code moreC++ idiomatic.) |
m (Reformatting a line of text which was overflowing the page width.) |
||
Line 285: | Line 285: | ||
for ( int example : examples ) { |
for ( int example : examples ) { |
||
System.out.println( |
System.out.println(String.format("%5d%18s%36s%13d", |
||
example, toHex(example), toBinary(example), twosComplement(example))); |
|||
} |
} |
||
} |
} |