Simple Predefined functions in c++


Function Name
Header File
Return Value
Parameter type
Return Type
abs(x)

<cstdlib>

Returns the absolute value of its argument: abs (-7) = 7

int
int
ceil(x)

<cmath>

Returns the smallest whole number that is not less than x: ceil (56.44) = 57.0

double
double
cos(x)

<cmath>

Returns the cosine of angle x: cos(0.0) = 1.0

double
Double
exp(x)

<cmath>

Returns ex , where e=  2.71828 : exp(1.0) = 2.71828

double
double
fabs(x)

<cmath>

Returns the absolute value of its argument: fabs(-5.67) = 5.67
double
double
floor(x)

<cmath>

Returns the largest whole number that is not greater than x: floor(45.67) = 45.00

double
double
pow (x, y)

<cmath>

Returns xy : if x is negative, y must be a whole number : pow(0.16, 0.5) = 0.4

double
double








avatar
AUTHOR: Muhammad Abbas
I am Software Engineer.

0 Comments