Open Tux opened 6 months ago
say √25; # expect 5 say √π; # expect 1.77245...
say ∛27; # expect 3 say ∜16; # expect 2
sub prefix:<√>(Numeric $n) { $n.sqrt }
Others are beyond my raku knowledge
Only problem I can spot is other scripts/programs/modules/scopes already defined it
That is not a problem in Raku: inner lexical defines always supersede outer defines
say √25; # expect 5 say √π; # expect 1.77245...
say ∛27; # expect 3 say ∜16; # expect 2
sub prefix:<√>(Numeric $n) { $n.sqrt }
Others are beyond my raku knowledge
Only problem I can spot is other scripts/programs/modules/scopes already defined it