什么是双数据类型的最小一步? (。净)双数、最小、类型

由网友(姐、绝版女子)分享简介:我的问题是有点理论,但实际上我需要在实践中。My question is a bit theoretical but actually I need it in practice.让我们假设我们有两个双变量的 X 和是。 是具有一定的下一个双号的 X (因为你已经知道,我们不能继续的任意的现实中的双由于实数是无限的...

我的问题是有点理论,但实际上我需要在实践中。

My question is a bit theoretical but actually I need it in practice.

让我们假设我们有两个双变量的 X 和是。 是具有一定的下一个双号的 X (因为你已经知道,我们不能继续的任意的现实中的双由于实数是无限的,即使在0到1的区间)。

Let's assume that we have two double variables X and Y. Y is certain next double number of X (as you already know we can't keep any real number in double because real number are infinite even in 0 to 1 interval).

难道(Y - X)是不变的?如果有什么是它的价值呢?

Does (Y - X) is constant? And if yes what is it's value?

P.S。我的问题是有关Microsoft.NET框架。

P.S. My question is related to Microsoft.NET Framework.

推荐答案

在.NET两个double值之间的最小差值是的 Double.Epsilon 。

The minimum difference between two double values in .NET is Double.Epsilon.

至于比较双重价值,看到了答案这太问题有用的信息(而作为公认的答案说,十进制应使用双尽可能)代替。

As for comparing double values, see the answers to this SO question for useful information (and as the accepted answer says, Decimal should be used instead of Double whenever possible).

阅读全文

相关推荐

最新文章