01 // Typkonvertierung
02 // cast / C
03 // Datei: tknum01.cpp
04
05 #include <iostream.h>
06 #include <math.h>
07
08 int main ()
09 {
10 double wohltemp;
11
12 wohltemp = pow (2.0, 1/12);
13 cout << "\nHalbton-Konstante: " <<
14   wohltemp << endl;
15
16 wohltemp = pow (2.0, (double)1/12);
17 cout << "\nHalbton-Konstante (mit Cast): " <<
18   wohltemp << endl;
19
20 return 0;
21 }
22

Bild 16-1  Typkonvertierung in numerischen Ausdrücken