Created
October 26, 2022 18:08
-
-
Save massa/251c826ccbede3da8e2e66dfb86d6f63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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