Last active
December 10, 2015 14:58
-
-
Save aeg/4451116 to your computer and use it in GitHub Desktop.
n進数表現
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Case #1 | |
// 数値の2進数、8進数、16進数、n進数表現(n進数以外はリテラル) | |
// 2進数(00001111) | |
assert 0b00001111 == 15 | |
// 8進数(0100) | |
assert 0100 == 64 | |
// 16進数(ff) | |
assert 0xff == 255 | |
// n進数(n=3 の場合) | |
assert Long.parseLong("221", 3) == 25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment