From accf08d0a23a67ca2fec9d802f4ab1d90b11726c Mon Sep 17 00:00:00 2001 From: benfry Date: Thu, 5 Oct 2006 23:12:28 +0000 Subject: [PATCH] make min/max functions not use Math.min/Math.max --- core/src/processing/core/PApplet.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index bfc308f81..176bbc990 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -2785,19 +2785,23 @@ public class PApplet extends Applet static public final float max(float a, float b) { - return Math.max(a, b); + //return Math.max(a, b); + return (a > b) ? a : b; } static public final float max(float a, float b, float c) { - return Math.max(a, Math.max(b, c)); + //return Math.max(a, Math.max(b, c)); + return (a > b) ? ((a > c) ? a : c) : ((b > c) ? b : c); } static public final float min(float a, float b) { - return Math.min(a, b); + //return Math.min(a, b); + return (a < b) ? a : b; } static public final float min(float a, float b, float c) { - return Math.min(a, Math.min(b, c)); + //return Math.min(a, Math.min(b, c)); + return (a < b) ? ((a < c) ? a : c) : ((b < c) ? b : c); }