From 68d012d986d54ec21ebcbe0fa9236d3880e33833 Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Mon, 11 Nov 2013 16:57:22 -0500 Subject: [PATCH] add in mathutil class w/ minInt method --- src/mantle/core/math/MathUtils.scala | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/mantle/core/math/MathUtils.scala diff --git a/src/mantle/core/math/MathUtils.scala b/src/mantle/core/math/MathUtils.scala new file mode 100644 index 0000000..69bf79c --- /dev/null +++ b/src/mantle/core/math/MathUtils.scala @@ -0,0 +1,29 @@ +package mantle.core.math + +/** +* Math Utilites +* +* various useful math utilites +* +* @author progwml6 +*/ +object MathUtils { + + /** + * finds smaller of 2 valid int's + * based on COFH's minI method + * @param a int variable + * @param b int variable + * @return the minimum of int's a & b + * */ + def minInt(a: Int, b: Int): Int = a < b ? a : b + /** + * finds smaller of 2 valid int's + * based on COFH's maxI method + * @param a int variable + * @param b int variable + * @return the maximum of int's a & b + * */ + def maxInt(a: Int, b: Int): Int = a > b ? a : b + +}