Skip to content

tomoyan/true_bits_perl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

true_bits_perl

TrueBits function in Perl

Write a function that when passed an integer returns an array with the indices (zero-indexed) of true bits in that integer, order is not important.

For example: true_bits(64) would return the array [6] because 64 equals 100000 in binary true_bits(983280) would return the array [4, 5, 6, 7, 16, 17, 18, 19] because 983280 equals 11110000000011110000 in binary

About

TrueBits decimal to binary conversion in Perl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages