From 9c070c323fb2d12f1c496558c7de794b9065ffe9 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Thu, 27 Oct 2011 18:48:01 +0200 Subject: [PATCH] Added ternary versions of min and max. --- .../com/sk89q/worldedit/expression/runtime/Functions.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/sk89q/worldedit/expression/runtime/Functions.java b/src/main/java/com/sk89q/worldedit/expression/runtime/Functions.java index 780431c86..eea797ca0 100644 --- a/src/main/java/com/sk89q/worldedit/expression/runtime/Functions.java +++ b/src/main/java/com/sk89q/worldedit/expression/runtime/Functions.java @@ -89,10 +89,18 @@ public final class Functions { return Math.min(a.invoke(), b.invoke()); } + public static final double min(Invokable a, Invokable b, Invokable c) throws Exception { + return Math.min(a.invoke(), Math.min(b.invoke(), c.invoke())); + } + public static final double max(Invokable a, Invokable b) throws Exception { return Math.max(a.invoke(), b.invoke()); } + public static final double max(Invokable a, Invokable b, Invokable c) throws Exception { + return Math.max(a.invoke(), Math.max(b.invoke(), c.invoke())); + } + public static final double ceil(Invokable x) throws Exception { return Math.ceil(x.invoke());