c++ double code example
Example 1: float in c++
float contains less storage than a double.
float p = 25.0;
double p = 25.0;
Example 2: casting to a double in c++
double x;
x = (double) 25;
Example 3: double to float c++
double v1 = 20120313.0;
float v2 = (float) v1;