Quantcast
Channel: Break an integer into even- and odd-indexed bits - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 15

Answer by lyxal for Break an integer into even- and odd-indexed bits

$
0
0

Vyxal 3, 12 bytes

„¿⌐bU;ᵛB?„¿⌐

Try it Online! (link is to literate version)

Could be 5 bytes if it wasn't for the negative input requirement.

Explained

negative? if-top: bitwise-not ## „¿⌐to-binary uninterleave pair vec: from-binary ## bU;ᵛBinput negative? if-top: bitwise-not ## ?„¿⌐

Viewing all articles
Browse latest Browse all 15

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>