add in mathutil class w/ minInt method

This commit is contained in:
Progwml6 committed 2013-11-11 16:57:22 -05:00
1 parent c400cd05e5
commit 68d012d986
1 file changed
+29
+29
View File
@@ -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
}