Wednesday, September 5, 2018

Math Library Function in C - Language for BCA Sem - 1 and PGDCA Sem - 1 Students



---------------------------------------------------------------------------------------------------------------------
Prepared By : Uday Shah (HOD - IT)
Contact No : 7600044051
E-Mail : rupareleducation@gmail.com


MATH LIBRARY FUNCTION

SQRT

Calculates square root of Given number

Declaration:
double sqrt(double x);
Remarks:
sqrt calculates the positive square root of the input value.

Sin
Declaration:
          double sin(double x);
Remarks:
Sin compute the sine of the input value, Angles are specified in radians.

Cos
Declaration:
          double cos(double x);
Remarks:
Cos compute the cosine of the input value, Angles are specified in radians.

Tan
Declaration:
          double tan(double x);
Remarks:
Tan calculate the tangent of the input value, Angles are specified in radians.



Power
Power function, x to the y (x**y)
Declaration:
double pow(double x, double y);
Remarks:
pow and powl calculate x**y.

modf
modf splits double into integer and fraction parts
Declaration:
double modf(double x, double *ipart);
Remarks:
modf breaks the double x into two parts: the integer and the fraction. It stores the integer in ipart and returns the fraction.

Log
log  =  natural logarithm function
log10 = common logarithm function

 Declaration:
double log(double x);
double log10(double x);      

Remarks:
log calculate the natural logarithm of x.
log10 calculate the base 10 logarithm of x.


FMOD
          Fmod function is used for floating pointing modularizing
 Declaration:
double fmod(double x, double y);
Remarks:
fmod calculate x modulo y. This is defined as the remainder




Ceil
ceil is used for  round up the value

Declaration:
double ceil(double x);

Remarks:
ceil finds the smallest integer not < x.

Floor
floor is used for  round down the value
Declaration:
double floor(double x);
Remarks:
floor finds the largest integer not > x.

Abs
abs (a macro) gets the absolute value of an integer
Declaration:
int abs(int x);       
Remarks:
All of these routines return the absolute value of their argument.

Fabs
fabs and fabsl calculate the absolute value of a floating-point number
Declaration:
          double fabs(double x);
Remarks:
All of these routines return the absolute value of their argument.

Exp
Real exp calculates e to the xth power
Declaration:
          double exp(double x);
 Remarks:
exp calculates the exponential function e of  X where Value of e is 2.718282

Div
div divides two integers
Declaration:
          div_t  div(int numer, int denom);
Remarks:
div divides two integers and returns both the quotient and the remainder as a div_t type.


ACOS , ASIN , ATAN

Arc cosine, arc sine, and arc tangent functions
Declaration:
double acos(double x);
double asin(double x);
double atan(double x);
Remarks:
acos  is compute the arc cosine of that value
asin is compute the arc sine of that value
atan is calculate the arc tangent of the input value