Skip to content

Instantly share code, notes, and snippets.

@diakopter
Last active December 19, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diakopter/5976904 to your computer and use it in GitHub Desktop.
Save diakopter/5976904 to your computer and use it in GitHub Desktop.
sub ndr(Int *@vals, Int :$radix = 10) {
die "radix must be positive" unless $radix > 0;
1+floor log (1 max [max] @vals>>.abs), $radix
};
say ndr(4,5,6,:radix(2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment