8.309618000000001D-02在QBASIC中是什么意思
我有一个 QBASIC 程序,基本上由公式和常量组成,我想将公式和常量转换为 C++ 程序。由于这些公式不是火箭科学,并且该程序有详细记录,因此我在翻译该程序时没有问题,尽管我以前没有使用过或见过 QBASIC。
但是,变量的初始化为 abc(15) = 9.207134000000001D-02
,我不确定如何解释 D-02。我猜我应该将其翻译为abc[15] =0.09207134....
,但我想验证这是否正确。
I have a QBASIC program that basically consists of formulas and constants, and I want to translate the formulas and constants into a C++ programm. Since the formulas are not rocket science and the program is well documented, I have no problem translating the program, although I have not used or seen QBASIC before.
However, there is an initialization of a variable that reads abc(15) = 9.207134000000001D-02
, and I am not sure how to interpret the D-02. I guess I should translate it like abc[15] =0.09207134....
, but I'd like to verify if this is correct.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我没记错的话,D-02 意味着乘以 10 的负 2 次方。
所以 8.309618000000001D-02 = 8.30961800000000 x 10^(-2)
大约是 0.08309618
我也认为 D 表示数字的类型是双精度型。
编辑:我已经很久没有写任何 QBASIC 代码了
If I recall correctly D-02 means times ten raised to the power minus 2.
So 8.309618000000001D-02 = 8.30961800000000 x 10^(-2)
which is roughly 0.08309618
I also think the D means the type of the number is a double.
EDIT: It's been ages since I wrote any QBASIC code
是的,他是对的,D 意味着该数字是双精度数,D 后面的 -2 意味着它乘以 10 的负 2 次方,这意味着它是 0.08309618 到 qbasics 双精度数字的精度,即 52 或 54如果我没记错的话
Yes he is right the D means that the number is a double and the -2 after the D means it is multiplied by 10 to the power of negative 2 which means it is 0.08309618 to the precision of qbasics double precision numbers which is 52 or 54 bits If I remember corectly