Skip to main content
added 4 characters in body
Source Link
Kjetil S
  • 6.1k
  • 10
  • 22

Perl 5, 37 bytes

sub{sprintf("%064b",@_)=~/^0*/;length$&;$+[0]}

Try it online!Try it online!

Or this 4346 bytes if the "stringification" is not allowed: sub z

sub{my$i=0;$_[0]>>64-$_?last:$i++for 1..64;$i}

Perl 5, 37 bytes

{sprintf("%064b",@_)=~/^0*/;length$&}

Try it online!

Or this 43 bytes if the "stringification" is not allowed: sub z

{my$i=0;$_[0]>>64-$_?last:$i++for 1..64;$i}

Perl 5, 37 bytes

sub{sprintf("%064b",@_)=~/^0*/;$+[0]}

Try it online!

Or this 46 bytes if the "stringification" is not allowed: sub z

sub{my$i=0;$_[0]>>64-$_?last:$i++for 1..64;$i}
Source Link
Kjetil S
  • 6.1k
  • 10
  • 22

Perl 5, 37 bytes

{sprintf("%064b",@_)=~/^0*/;length$&}

Try it online!

Or this 43 bytes if the "stringification" is not allowed: sub z

{my$i=0;$_[0]>>64-$_?last:$i++for 1..64;$i}