计算差异 [英] Calculation Discrepancy

查看:163
本文介绍了计算差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含简单计算的模块:


R =(X * D)/ V


所有值均为Double 。


使用以下数值:


X = 95

D = 10000

V = .0225


我得到42,222,222.22,但Access给了我42,222,220.5444619。


Access如何计算这个以及如何纠正它?

I have a module that contains a simple calculation:

R = (X * D) / V

All values are Double.

Using the following values:

X = 95
D = 10000
V = .0225

I get 42,222,222.22, but Access gives me 42,222,220.5444619.

How is Access calculating this and how can I correct it?

推荐答案

使用计算器,Excel spdsheet,并在Access查询设计网格中输入值,都会产生完全相同的结果:42,222,222.22


让我们来看看你用于函数的整个代码。另外,仔细查看每种数据类型,特别是查找它们可能通过声明更改的任何时间,即从Integer到Double等等。


问候,

Scott


ps将代码粘贴到此回复窗口时,选择所有代码,通过单击上面的#符号将其包装在代码标记中,然后手动编辑第一个选项卡,如下所示:[code = vb]谢谢!
Using a calculator, Excel spdsheet, and typing the values into an Access query design grid all produce exactly the same results for me: 42,222,222.22

Let''s take a look at the whole code you are using for your function. Also, take a very close look at each data type, especially looking for any times they might go through declaration changes, i.e. from Integer to Double, etc.

Regards,
Scott

p.s. when pasting the code into this reply window, select all the code, wrap it in code tags by clicking the # sign above, and manually edit the first tab to look just like this: [code=vb] Thanks!


谢谢Scott,


希望它在这里的某个地方。同样在数据来自X的表中,V和D是单一的。

Thanks Scott,

Hopefully it''s somewhere in here. Also in the table where the data is coming from X, V and D are Single.

展开 | 选择 < span class =codeDivider> | Wrap | 行号



谢谢Scott,


希望它在这里的某个地方。同样在数据来自X的表中,V和D是单一的。

Thanks Scott,

Hopefully it''s somewhere in here. Also in the table where the data is coming from X, V and D are Single.

展开 | 选择 < span class =codeDivider> | Wrap | 行号


这篇关于计算差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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