float r = 5.0;

The value 5.0 is a number represented as a decimal fraction (has an integer and a fractional part). In computer science, such numbers are called real.
A real number is a number that has an integer part and a fractional part. The integer and fractional parts oare separated from each other comma.
Even if the fractional part of the number is zero, as in the r  variable in the example, the translator will still create a real variable in memory. The period serves as a signal to the translator that it is necessary to create a real variable. 

Very large and very small numbers  are written using "floating point" (in the so-called scientific format).  
In scientific format, a number is represented as mantissa(significant part of the number) and exponent. When writing, the mantissa and the exponent are separated from each other by the letter e (denoting 10 to some degree). 
For example, you can store the value of the charge of an electron ( \(1.60217662 \times 10^{-19}\) C) in a variable, 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, when calculating with real numbers, errors associated with the inaccuracy of the representation accumulate. Moreover, the less space 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 (occupies eight bytes in memory, while the float type > - 4 bytes).