mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-25 22:34:29 +00:00
add in mathutil class w/ minInt method
This commit is contained in:
1 parent
c400cd05e5
commit
68d012d986
1 file changed
+29
@@ -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
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user