public static double FactorialRatio(long x, long y) { Contract.Requires(0 <= x); Contract.Requires(0 <= y); var start = Functions.Min(x, y); var end = Functions.Max(x, y); var result = 1L; for (var i = start + 1; i <= end; ++i) { result *= i; } return(x > y ? result : 1.0 / result); }
public static Vector2sb Max(Vector2sb value1, Vector2sb value2) { return(new Vector2sb(Functions.Max(value1.X, value2.X), Functions.Max(value1.Y, value2.Y))); }
/// <summary> /// Returns a matrix that contains the highest value from each pair of elements. /// </summary> /// <param name="value1">The first matrix.</param> /// <param name="value2">The second matrix.</param> /// <returns>The highest of each element in left and the matching element in right.</returns> public static Matrix3x2d Max(Matrix3x2d value1, Matrix3x2d value2) { return(new Matrix3x2d(Functions.Max(value1.M11, value2.M11), Functions.Max(value1.M21, value2.M21), Functions.Max(value1.M31, value2.M31), Functions.Max(value1.M12, value2.M12), Functions.Max(value1.M22, value2.M22), Functions.Max(value1.M32, value2.M32))); }
/// <summary> /// Returns a vector that contains the highest value from each pair of components. /// </summary> /// <param name="value1">The first vector.</param> /// <param name="value2">The second vector.</param> /// <returns>The highest of each component in left and the matching component in right.</returns> public static Vector8l Max(Vector8l value1, Vector8l value2) { return(new Vector8l(Functions.Max(value1.V0, value2.V0), Functions.Max(value1.V1, value2.V1), Functions.Max(value1.V2, value2.V2), Functions.Max(value1.V3, value2.V3), Functions.Max(value1.V4, value2.V4), Functions.Max(value1.V5, value2.V5), Functions.Max(value1.V6, value2.V6), Functions.Max(value1.V7, value2.V7))); }
/// <summary> /// Returns a matrix that contains the highest value from each pair of elements. /// </summary> /// <param name="value1">The first matrix.</param> /// <param name="value2">The second matrix.</param> /// <returns>The highest of each element in left and the matching element in right.</returns> public static Matrix4x2f Max(Matrix4x2f value1, Matrix4x2f value2) { return(new Matrix4x2f(Functions.Max(value1.M11, value2.M11), Functions.Max(value1.M21, value2.M21), Functions.Max(value1.M31, value2.M31), Functions.Max(value1.M41, value2.M41), Functions.Max(value1.M12, value2.M12), Functions.Max(value1.M22, value2.M22), Functions.Max(value1.M32, value2.M32), Functions.Max(value1.M42, value2.M42))); }
/// <summary> /// Returns a matrix that contains the highest value from each pair of elements. /// </summary> /// <param name="value1">The first matrix.</param> /// <param name="value2">The second matrix.</param> /// <returns>The highest of each element in left and the matching element in right.</returns> public static Matrix2x3f Max(Matrix2x3f value1, Matrix2x3f value2) { return(new Matrix2x3f(Functions.Max(value1.M11, value2.M11), Functions.Max(value1.M21, value2.M21), Functions.Max(value1.M12, value2.M12), Functions.Max(value1.M22, value2.M22), Functions.Max(value1.M13, value2.M13), Functions.Max(value1.M23, value2.M23))); }
/// <summary> /// Returns a matrix that contains the highest value from each pair of elements. /// </summary> /// <param name="value1">The first matrix.</param> /// <param name="value2">The second matrix.</param> /// <returns>The highest of each element in left and the matching element in right.</returns> public static Matrix3x4d Max(Matrix3x4d value1, Matrix3x4d value2) { return(new Matrix3x4d(Functions.Max(value1.M11, value2.M11), Functions.Max(value1.M21, value2.M21), Functions.Max(value1.M31, value2.M31), Functions.Max(value1.M12, value2.M12), Functions.Max(value1.M22, value2.M22), Functions.Max(value1.M32, value2.M32), Functions.Max(value1.M13, value2.M13), Functions.Max(value1.M23, value2.M23), Functions.Max(value1.M33, value2.M33), Functions.Max(value1.M14, value2.M14), Functions.Max(value1.M24, value2.M24), Functions.Max(value1.M34, value2.M34))); }
/// <summary> /// Returns a matrix that contains the highest value from each pair of elements. /// </summary> /// <param name="value1">The first matrix.</param> /// <param name="value2">The second matrix.</param> /// <returns>The highest of each element in left and the matching element in right.</returns> public static Matrix4x3f Max(Matrix4x3f value1, Matrix4x3f value2) { return(new Matrix4x3f(Functions.Max(value1.M11, value2.M11), Functions.Max(value1.M21, value2.M21), Functions.Max(value1.M31, value2.M31), Functions.Max(value1.M41, value2.M41), Functions.Max(value1.M12, value2.M12), Functions.Max(value1.M22, value2.M22), Functions.Max(value1.M32, value2.M32), Functions.Max(value1.M42, value2.M42), Functions.Max(value1.M13, value2.M13), Functions.Max(value1.M23, value2.M23), Functions.Max(value1.M33, value2.M33), Functions.Max(value1.M43, value2.M43))); }