Created
April 13, 2014 09:13
-
-
Save libitte/10575858 to your computer and use it in GitHub Desktop.
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
| == 10進法 -> 2進法, 2進法 -> 10進法 | |
| http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1210460042 | |
| - 2 -> 10 | |
| ex) 1111001 | |
| 1*2^6 + 1*2^5 + 1*2^4 + 1*2^3 + 1*2^0 | |
| 64+32+16+8+1 | |
| =121 | |
| - 10 -> 2 | |
| ex) 45 | |
| 1, 2, 4, 8, 16, 32, 64, 128 | |
| 6桁目にbitを建てる | |
| 45 - 32 = 13 | |
| 4桁目にbitを建てる | |
| 13 - 8 = 5 | |
| 3桁目にbitを建てる | |
| 5 - 4 = 1 | |
| 1桁目にbitを建てる | |
| 1 - 1 = 0 | |
| ans. 101101 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment