E-mail this post

Remember me (?)

All personal information that you provide here will be governed by the Privacy Policy of More...

#include <math.h>, syntax at the beginning of our code, means we automatically included these (pre-defined) functions in our program:

int abs (int x); IxI
long labs (long x);

double fabs (double x);
double sin (double x);
double cos (double x);
double tan (double x);
double asin (double x);
double acos (double x);
double atan (double x);
double sinh (double x);
double cosh (double x);
double tanh (double x);

double exp (double x); ex
double log (double x); ln x
double log10 (double x); log x

double pow (double x,double y); xy
double sqrt(double x); sqare root of x
double fmod(double x, double y); x mod y

double ceil (double x);
double floor(double x);

Technorati Tags:
, , , , , ,

1 Responses to “math.h”

  1. Anonymous Mortis 

    The only thing I'm missing here is the unit-system that is used for angular calculations (sin, cos, tan and its variants). I mean in the sense of radians, degrees, etc.

    And as for the log(), you might want to put the base value thats used near it (base=e=2.718281828).

    PS, another trick I like to apply myself when I need to calculate the root of another power than 2 is: pow(number, 1/power)

Leave a Reply

      Convert to boldConvert to italicConvert to link


German Flag Spanish Flag French Flag Italian Flag Portuguese Flag Japanese Flag Korean Flag Chinese Flag British Flag

This Website is optimized for Firefox. Users browsing with Internet Explorer may encounter problems while viewing pages.

C++ Maniac

Learn C



Learn Converting



Previous posts

Daily Lessons for programming in Visual Studio, using C code.