相关疑难解决方法(0)

C#中的BigInteger部门

我正在编写一个需要在C#中准确划分BigInteger类的类.

例:

BigInteger x = BigInteger.Parse("1000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
BigInteger y = BigInteger.Parse("2000000000000000000000000000000000000000000000000000000000000000000000000000000000000");

x /= y;

Console.WriteLine(x.ToString());

//Output = 0
Run Code Online (Sandbox Code Playgroud)

问题是作为一个整数,自然它不包含十进制值.我怎样才能克服这一点,得到0.5的实际结果(给出的例子).

PS解决方案必须能够准确地划分任何BigInteger,而不仅仅是示例!

.net c# biginteger division

11
推荐指数
2
解决办法
5258
查看次数

标签 统计

.net ×1

biginteger ×1

c# ×1

division ×1