Created
January 11, 2018 01:36
-
-
Save mike-neck/b967b5140f082500d724ef0d0636a76a to your computer and use it in GitHub Desktop.
2進数の確認
This file contains 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
[0,1,2,29,30,31,32] | |
.collect { [original: it, current: (2 as int) ** it as int, sum: (0..it).collect { (2 as int) ** it as int }.sum()] } | |
.collect { [original: it.original, current: it.current, chex: Integer.toHexString(it.current), sum: it.sum, shex: Integer.toHexString(it.sum)] } | |
.each { println it } |
This file contains 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
[original:0, current:1, chex:1, sum:1, shex:1] | |
[original:1, current:2, chex:2, sum:3, shex:3] | |
[original:2, current:4, chex:4, sum:7, shex:7] | |
[original:29, current:536870912, chex:20000000, sum:1073741823, shex:3fffffff] | |
[original:30, current:1073741824, chex:40000000, sum:2147483647, shex:7fffffff] | |
[original:31, current:-2147483648, chex:80000000, sum:-1, shex:ffffffff] | |
[original:32, current:0, chex:0, sum:-1, shex:ffffffff] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment