Find first and last set bit of a long integer: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: change the output's title, split a long statement, used control to minimize blank lines (between output sets), added whitespace, added a comment.) |
m (→machine-sized integers: removed errant tag) |
||
Line 1,217: | Line 1,217: | ||
There is nothing like this already built in, so we will roll our own, in low-level assembly. <br> |
There is nothing like this already built in, so we will roll our own, in low-level assembly. <br> |
||
Of course you would normally hide this sort of stuff out of sight, far away from the usual day-to-day code. |
Of course you would normally hide this sort of stuff out of sight, far away from the usual day-to-day code. |
||
<!--<lang Phix> |
<!--<lang Phix>--> |
||
<span style="color: #008080;">without</span> <span style="color: #008080;">javascript_semantics</span> |
<span style="color: #008080;">without</span> <span style="color: #008080;">javascript_semantics</span> |
||
<span style="color: #008080;">function</span> <span style="color: #000000;">msb</span><span style="color: #0000FF;">(</span><span style="color: #004080;">integer</span> <span style="color: #000000;">i</span><span style="color: #0000FF;">)</span> |
<span style="color: #008080;">function</span> <span style="color: #000000;">msb</span><span style="color: #0000FF;">(</span><span style="color: #004080;">integer</span> <span style="color: #000000;">i</span><span style="color: #0000FF;">)</span> |