a guest May 19th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- public static class MathUtil
- public static IEnumerable<int> DivideEvenly(int numerator, int denominator)
- var div = Math.DivRem(numerator, denominator, out int rem);
- for (int i = 0; i < denominator; i++)
- yield return i < rem ? div + 1 : div;
RAW Paste Data