Domanda

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.

È stato utile?

Soluzione

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

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top