From b4f129835a49eeb3dd09142ea055c44a479e3421 Mon Sep 17 00:00:00 2001 From: PaddiM8 Date: Tue, 9 Jun 2020 20:50:05 +0200 Subject: [PATCH] Added gamma function. --- kalk/src/prelude.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kalk/src/prelude.rs b/kalk/src/prelude.rs index 977452c..2b6d8a6 100644 --- a/kalk/src/prelude.rs +++ b/kalk/src/prelude.rs @@ -46,6 +46,8 @@ pub const UNARY_FUNCS: phf::Map<&'static str, UnaryFuncInfo> = phf::phf_map! { "exp" => UnaryFuncInfo(exp, Other), "floor" => UnaryFuncInfo(floor, Other), "frac" => UnaryFuncInfo(frac, Other), + "gamma" => UnaryFuncInfo(gamma, Other), + "Γ" => UnaryFuncInfo(gamma, Other), "log" => UnaryFuncInfo(log, Other), "ln" => UnaryFuncInfo(ln, Other), "round" => UnaryFuncInfo(round, Other), @@ -243,6 +245,10 @@ mod funcs { x.fract() } + pub fn gamma(x: Float) -> Float { + x.gamma() + } + pub fn hyp(x: Float, y: Float) -> Float { x.hypot(&y) }