From: Charlie Brej Date: Wed, 8 Jul 2009 09:40:02 +0000 (+0100) Subject: [script] Correct the math min and max functions X-Git-Tag: 0.7.0~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d32a075e7a5ca21ec72dad9a6d54ddc31df01501;p=thirdparty%2Fplymouth.git [script] Correct the math min and max functions Were the wrong way round and confusingly written. Also adds a MathPi constant. --- diff --git a/src/plugins/splash/script/script-lib-math.script b/src/plugins/splash/script/script-lib-math.script index c90bba04..d71b338b 100644 --- a/src/plugins/splash/script/script-lib-math.script +++ b/src/plugins/splash/script/script-lib-math.script @@ -3,14 +3,14 @@ fun MathAbs (value){ return value; } -fun MathMin (value, min){ - if (value < min) return min; - return value; +fun MathMin (value_a, value_b){ + if (value_a < value_b) return value_a; + return value_b; } fun MathMax (value, max){ - if (value > max) return max; - return value; + if (value_a > value_a) return value_a; + return value_b; } fun MathClamp (value, min, max){ @@ -18,3 +18,6 @@ fun MathClamp (value, min, max){ if (value > max) return max; return value; } + + +MathPi = 3.14159265358979323846;