Search code examples
number-formattingqbasic

What does 8.309618000000001D-02 mean in QBASIC


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.


Solution

  • 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