How to simplify a fraction in C#? For example, given 1 11/6, I need it simplified to 2 5/6.
1 11/6
2 5/6
int num = 11; int denom = 6; int unit = 1; while (num >= denom) { num -= denom; unit++; }
Sorry I didn't fully understand that part about keeping track of the unit values.