Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有任何标准 C# 类型或库用于精确的有理算术,如除法?
十进制不是我需要的:
1m/3m + 1m/3m + 1m/3m != 1
我正在考虑存储两个小数,分子和分母,并精确执行乘法和除法的东西。它可以在需要时简化分数并显式转换为双精度或小数。