Created
January 4, 2013 09:06
-
-
Save aeg/4451086 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進数表現 | |
// 2進数(00001111) | |
assert 0b00001111 == 15 | |
// 8進数(0100) | |
assert 0100 == 64 | |
// 16進数(ff) | |
assert 0xff == 255 | |
// n進数 | |
assert 25 == Long.parseLong("221", 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment