From 835b0b2598deb80583faee261798a8c4768bbc6a Mon Sep 17 00:00:00 2001 From: Albin Hedman Date: Mon, 28 Jul 2025 23:43:43 +0200 Subject: [PATCH] Add ln --- shunting/src/rpneval.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/shunting/src/rpneval.rs b/shunting/src/rpneval.rs index 80f994b..ae2baf0 100644 --- a/shunting/src/rpneval.rs +++ b/shunting/src/rpneval.rs @@ -202,6 +202,7 @@ fn eval_fn(fname: &str, args: &[f64]) -> Result { "atan2" if args.len() == 2 => args[0].atan2(args[1]), "cos" if args.len() == 1 => args[0].cos(), "log" if args.len() == 1 => args[0].log10(), + "ln" if args.len() == 1 => args[0].ln(), "max" if !args.is_empty() => args.iter().fold(args[0], |a, &b| a.max(b)), "min" if !args.is_empty() => args.iter().fold(args[0], |a, &b| a.min(b)), // Order not important