Attach to Process: Start the dialog with the filter set to the program name.
[kdbg.git] / kdbg / testprogs / maths.cpp
blobc69e98d587eaacf6ae6413e03c2e37c751b337aa
1 // do some floatingpoint computations
2 #include <math.h>
3 #include <stdio.h>
5 double deg2rad(double a)
7 double result;
8 result = a * 3.141592653589793 / 180.0;
9 return result;
12 #define pi 3.1415926535897932384626433832795028841971693993750
14 void longdouble(long double ld)
16 long double x = 1000000.0 * ld*ld*pi;
17 printf("long double: %Lf\n", x);
20 int main(int argc, char** argv)
22 double a = 17.4;
23 double b = deg2rad(a);
24 double sine = sin(b);
26 printf("angle=%f degrees (%f radians), sine is %f\n",
27 a, b, sine);
29 longdouble(17.0);