How to simplify fractions in C#?

前端 未结 5 2365
暗喜
暗喜 2020-12-11 17:55

I\'m looking for a library or existing code to simplify fractions.

Does anyone have anything at hand or any links?

P.S. I already understand the process but r

5条回答
  •  一生所求
    2020-12-11 18:30

    The best example of Fraction (aka Rational) I've seen is in Timothy Budd's "Classic Data Structures in C++". His implementation is very good. It includes a simple implementation of GCD algorithm.

    It shouldn't be hard to adapt to C#.

提交回复
热议问题