双数据类型的最小步骤是什么? (。净) [英] What is the minimal step in double data type? (.NET)

查看:160
本文介绍了双数据类型的最小步骤是什么? (。净)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我们假设我们有两个双重变量 X Y Y 是下一个双重数字 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?

我的问题与Microsoft.NET Framework有关。

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.

对于比较双重值,请参阅此SO问题的答案< a>有用的信息(并且被接受的答案说,十进制而不是Double)。

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).

这篇关于双数据类型的最小步骤是什么? (。净)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆