Gray code: Difference between revisions
m
Test results were overflowing the length of a line.
(An existing post had a warning message on a yellow background stating that the code had not been fully tested. This post adds the missing tests while altering the existing post as little as possible.) |
m (Test results were overflowing the length of a line.) |
||
Line 3,224:
System.out.println();
final BigInteger base = BigInteger.TEN.pow(
for ( int i = 0; i < 5; i++ ) {
BigInteger test = base.add(BigInteger.valueOf(i));
Line 3,275:
31 11111 10000 10000 31
test decimal =
gray code decimal =
gray code binary = 110001100111010111110010000111011100111111111011111110101111100100001000111110111011
decoded decimal =
decoded2 decimal =
test decimal =
gray code decimal =
gray code binary = 110001100111010111110010000111011100111111111011111110101111100100001000111110111010
decoded decimal =
decoded2 decimal =
test decimal =
gray code decimal =
gray code binary = 110001100111010111110010000111011100111111111011111110101111100100001000111110111110
decoded decimal =
decoded2 decimal =
test decimal =
gray code decimal =
gray code binary = 110001100111010111110010000111011100111111111011111110101111100100001000111110111111
decoded decimal =
decoded2 decimal =
test decimal =
gray code decimal =
gray code binary = 110001100111010111110010000111011100111111111011111110101111100100001000111110111101
decoded decimal =
decoded2 decimal =
</pre>
|