Page 19 - PROGRAMMING IN C_Neat
P. 19

 General Form:

                        double  cos(double  a);

           Example:
               double  x = cos(3.14/2);     Output:
                                            x = 0 (approx.)

        3. tan():
           Used to find the tan value of its argument.
           General Form:

                        double  tan(double  a);

           Example:
               double  x = tan(3.14/2);

        4. exp():
           Used to find the exponent value of its argument.
           General Form:
                        double  exp(double  a);

           Example:
               double  x = exp(4.6);  x = e 4.6

        5. floor():
           Used to round down a float number.
           General Form:
                        double  floor(double  a);

           Example:
               double  x = floor(93.58);    Output:
                                            x = 93

        6. ceil():
           Used to round up a float number.
           General Form:

                        double  ceil(double  a);

           Example:
               double  x = ceil(93.58);     Output:
                                            x = 94

        7. abs():
           Used to find the absolute value of an integer. Absolute value is the value without sign.
           General Form:

                        int  abs(int  a);

           Example:
               int  x = abs(-6);            Output:
                                            x = 6

        8. pow():
           Used to find the power of a value.
           General Form:

                        double  pow(double  a, double  b);
   14   15   16   17   18   19   20   21   22   23   24