标签:
public class Divisor { private static Divisor instance; public static Divisor Instance { get {if(instance == null) instance = new Divisor(); return instance; } } float y, minDivisor; public float MinDivisor(float x1,float x2,float lerp) { if (x1 < 0 || x2 < 0 || lerp < 0) return 0; float y = x1 % x2; if (y > lerp) { x1 = x2; x2 = y; MinDivisor(x1, x2,lerp); } else minDivisor = x2; return minDivisor; } public float MinDivisor(float[] X_Arroy, float lerp) { List<float> div_Arroy = new List<float>(); for (int i = 0; i < X_Arroy.Length-1; i++) { div_Arroy.Add(MinDivisor(X_Arroy[i], X_Arroy[i + 1], lerp)); } if (div_Arroy.Count > 1) return MinDivisor(div_Arroy.ToArray(), lerp); else return div_Arroy[0]; } }
标签:
原文地址:http://www.cnblogs.com/redUnity/p/5353291.html