Do you think that the following is legal?
double rats = 8912D ; A good answer might be:Yes. The 'D' will make the literal a double (even though it lacks a decimal point). |
Scientific Notationordouble rats = 8912 ; The first statement (above) works, but is "sloppy" coding. The integer literal must be converted into a double before the variable is initialized. In the second statement the variable is initialized to the double literal.double rats = 8912.0 ; You will sometimes see scientific notation. The following are all double-precision literals: 1.23E+02 -1.235E+02 -1.98234234E+05 3.81E-06 Another way of regarding the integer that follows the "E" is that it says in which direction and for how many places to shift the decimal point. Positive integers mean right shifts; negative integers mean left shifts. |
QUESTION 10:What is the following number if written out the usual way: 1.9343E+03Click Here after you have answered the question |