1 module polyplex.utils.mathutils; 2 3 class Math { 4 /** 5 Returns the smallest of the two specified doubles. 6 */ 7 public static double Min(double a, double b) { 8 if (a < b) return a; 9 return b; 10 } 11 12 /** 13 Returns the biggest of the two specified doubles. 14 */ 15 public static double Max(double a, double b) { 16 if (a > b) return a; 17 return b; 18 } 19 20 /** 21 Returns the smallest of the two specified integers. 22 */ 23 public static int Min(int a, int b) { return cast(int)Min(cast(double)a, cast(double)b); } 24 25 /** 26 Returns the biggest of the two specified integers. 27 */ 28 public static int Max(int a, int b) { return cast(int)Max(cast(double)a, cast(double)b); } 29 }