Check out example codes for "casting to a double in c++". It will help you in understanding the concepts better.

Code Example 1

double x;
x = (double) 25;

Code Example 2

int a{5},b{2},c{9};
double d = (double)a / (double)b + (double)c;

Learn ReactJs, React Native from akashmittal.com