Created
November 27, 2015 23:05
-
-
Save timsgardner/4063a68967c138108024 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static float[] subdivArray(float n, float div){ | |
float flr = Mathf.Floor(n / div); | |
float rem = Mathf.Mod(n, div); | |
r = Enumerable.Range(0, flr).Select(i => i * div); | |
if(rem == 0){ | |
return r.ToArray; | |
}else{ | |
return r.Concat(new float[]{rem}).ToArray; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment