Skip to content

Instantly share code, notes, and snippets.

@massa
Created October 26, 2022 18:08
Show Gist options
  • Save massa/251c826ccbede3da8e2e66dfb86d6f63 to your computer and use it in GitHub Desktop.
Save massa/251c826ccbede3da8e2e66dfb86d6f63 to your computer and use it in GitHub Desktop.
#!/usr/bin/env raku
use v6;
use NativeCall;
sub Γ(num64 --> num64) is native('m', v6) is symbol('tgamma') { * }
sub postfix:<!>(Num() $x) { Γ $x + 1 }
sub √(Num() $x) { $x.sqrt }
say ½!;
say √π ÷ 2;
use Test;
is-approx ½!, √π ÷ 2, "½! ≅ √π ÷ 2";
done-testing;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment