Skip to content

Instantly share code, notes, and snippets.

@Altreus
Created November 13, 2020 18:27
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 Altreus/2d3a71fdd7842f3d76c9c61d3afa81ee to your computer and use it in GitHub Desktop.
Save Altreus/2d3a71fdd7842f3d76c9c61d3afa81ee to your computer and use it in GitHub Desktop.
multi to-base-alphabet ( Real $num, @alphabet, :$precision = -15 ) is export {
temp @__base-any-digits = @alphabet;
temp $threshold = +@alphabet;
say $threshold;
return convert-arbitrary-base( $num, $threshold, :$precision ); # 137
}
Cannot resolve caller convert-arbitrary-base(0.1, 4516, :precision(-15)); none of these signatures match:
(Int $num, Int $radix where { ... })
(Real $num, Int $radix where { ... }, :$precision)
in sub to-base-alphabet at /home/altreus/src/Base-Any/lib/Base/Any.pm6 (Base::Any) line 137
in block <unit> at t/01-basic.t line 66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment