Example: cos

The following example calculates the cosine of 45 degrees using cos.

    #include <math.h> 
    double cos(double x); 
    double x = 45;
    lr_output_message ("Cosine of %lf deg = %lf", x, cos(x * PI/180));
Output:
Action.c(9): Cosine of 45.000000 deg = 0.707107