开发者

What does 8.309618000000001D-02 mean in QBASIC

开发者 https://www.devze.com 2023-02-05 14:32 出处:网络
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 pro

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.开发者_如何学C

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.


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号