Find first and last set bit of a long integer: Difference between revisions
Content deleted Content added
→{{header|Icon}} and {{header|Unicon}}: forgot output |
|||
Line 303: | Line 303: | ||
[http://www.cs.arizona.edu/icon/library/src/procs/hexcvt.icn hexcvt.icn provides hexstring] |
[http://www.cs.arizona.edu/icon/library/src/procs/hexcvt.icn hexcvt.icn provides hexstring] |
||
Output:<pre> |
Output:<pre>42^0 = 1 (x00000001) : MSB=0 LSB=0 |
||
42^1 = 42 (x0000002A) : MSB=5 LSB=1 |
|||
42^2 = 1764 (x000006E4) : MSB=10 LSB=2 |
|||
42^3 = 74088 (x00012168) : MSB=16 LSB=3 |
|||
42^4 = 3111696 (x002F7B10) : MSB=21 LSB=4 |
|||
42^5 = 130691232 (x07CA30A0) : MSB=26 LSB=5 |
|||
1302^0 = 1 (x0000000000000001) : MSB=0 LSB=0 |
|||
1302^1 = 1302 (x0000000000000516) : MSB=10 LSB=1 |
|||
1302^2 = 1695204 (x000000000019DDE4) : MSB=20 LSB=2 |
|||
1302^3 = 2207155608 (x00000000838E8598) : MSB=31 LSB=3 |
|||
1302^4 = 2873716601616 (x0000029D16DB7310) : MSB=41 LSB=4 |
|||
1302^5 = 3741579015304032 (x000D4AF2401B3360) : MSB=51 LSB=5 |
|||
1302^6 = 4871535877925849664 (x439B2C120A574A40) : MSB=62 LSB=6</pre> |
|||
=={{header|J}}== |
=={{header|J}}== |