Let's start with the fact that I am familiar with the double type, but I do not understand its range:

double от -4.9e-324 до 1.7e+308 

And therefore I can’t understand below the variable that takes on itself the following value: 6.67300E-11 , please explain what is E and a hyphen from 11

 // Гравитационная постоянная, мА3 / кг-эА2 private static final double G = 6.67300E-11; 

3.302e + 23 is 3.302 * 10 ^ 23?

And the difference between 3.302e + 23 and 2.439e6

Wikipedia stumbled on this:

enter image description here

  • 3
    This is called exponential notation . At school, like, pass. - Enikeyschik 1:02 pm
  • in English literature Scientific notation - Stranger in the Q
  • I can not understand about the range double - user331073 pm
  • 3
    Possible duplicate question: What does “5e-6” in C # mean? - Grundy
  • 2
    And what exactly is your question "deeper"? - AnT 1:29 pm

1 answer 1

About E in the comments have already written that this is an exponential notation .

x E y means x × 10 y .

Now for the double range.

Double precision floating point numbers, those double occupy 64 bits. Of these, 1 bit is a sign (1 is a negative number, 0 is positive), 11 bits is an order and 52 bits is a mantissa .

Order is a degree. Eleven bits are enough to hold a degree from -1022 to +1023, plus two special cases . More precisely, in binary numbers we raise to the power of 2, not 10, so we are talking about numbers from 2-1022 to 2 1023 .

If we translate to indicator 10, we will get from ~ 10 -308 to ~ 10 308

A mantissa is the fractional part of a number in binary notation. For example, 100 ... 000 2 (here 52 binary digits) mean the number 1,100 ... 000 2 .

The upper bound 1.7 × 10 308 is actually 1.111 ... 111 2 × 2 1023 .

Normal fractional numbers in the region close to zero are equal to 1,000 ... 000 2 × 2 -1022 , that is, somewhere 2.2 × 10 -308 .

The question is where did the -324 indicator come from. This is one of their special cases , the so-called unnormalized numbers. I would not recommend working in this range, since the accuracy here is already less than 52 binary characters.