Real numbers




float r = 5.0
The value 5.0 is a number represented as a decimal fraction (has an integer and fractional part). In computer science, such numbers are called real
A real number is a number in which there is an integer and fractional parts. The integer and fractional parts are separated by a dot, not a comma, as in mathematics.
Even if the fractional part of the number is zero, as in the variable r in the example, the translator will still create a real variable in memory. The point, as it were, is a signal for the translator that it is necessary to create a real variable.

Very large and very small numbers are written using a "floating point" (in the so-called scientific format).
In a scientific format, the number is represented in the form of a mantissa (a significant part of the number) and order. When recording, the mantissa and the order are separated from each other by the letter e (denotes 10 to some extent).
For example, you can save the value of the electron charge (\(1,60217662 \times 10^{-19}\)) in a variable by writing in the following form
float El = 1.60217662e-19 # for a positive order, the + sign can be omitted
Almost all real numbers cannot be stored in computer memory with perfect accuracy, since a limited number of bits are allocated for their storage. Therefore, in calculations with real numbers, errors associated with inaccuracy of the representation are accumulated. Moreover, the less space is allocated, the greater this error will be. In order to reduce the error in C ++, they use the double type, which stores a real number with double precision in memory (it takes eight bytes in memory, while the type \(float \) takes 4 bytes)
 

ЗАДАЧА
The program printed the number below in scientific format. Write it in the "normal" form (use a comma as a separator for the integer and fractional parts)
\(1.2345e+001\)

Ответ:

     
Результаты проверки: