Ad Code

Responsive Advertisement

C++ functions list - Learn CPP

C++ functions list - Learn CPP, There are a lot of ready-made functions in the programming language (C++) that can be used with numbers and also used to perform arithmetic operations, and there are a group of these functions that can be used directly; Because they are known to the compiler in the programming language (C++) by default and some functions need to be included by yourself first so that you can use them, and in order for the user to benefit from these functions, a file called (cmath) must be included.


C++ functions list - Learn CPP


The most important functions used in the C++ programming language


Here is a list of the most important functions in C++:


function abs(x)


It is used to find the (absolute value) of the number we are using (x).


function fabs(x)


This function is used to calculate the absolute value of a number whose type (float) contains a decimal point.


function floor(x)


Returns the integer smaller or equal to the number we pass to this function in place of the parameter (x).


function ceil(x)


It is used to find an integer greater than or equal to the number we pass to it in place of the parameter (x).


function rint(x)


Used to calculate and find the closest integer to the number we use with this function in place of the parameter (x).


function fmax(x,y)


It is used to find the greater of the two numbers we pass in place (x) and (y).


function fmin(x,y)


It is used to find the smaller number between the two numbers we pass in place of the parameters (x) and (y).


function fmod(x,y)


Used to calculate the remainder of dividing the value of (x) by the value of (y).


function pow(x,y)


This function is used to multiply a value (x) by a value (y) and then return the result.


function sqrt(x)


This function is used to calculate the square root of the number we pass to a place (x).


function cbrt(x)


Used to calculate the cube root of the number we use in place of (x).


function hypot(x,y)


This function is used to calculate the hypotenuse value, i.e. sqrt(x2 +y2) is calculated while keeping any number after the comma


function exp(x)


This function is used to calculate the (Exponential) value of the number we use in place of (x).


function log(x)


This function is used to calculate the logarithm value of the number we use in place of (x).


function sin(x)


Used to calculate the sine of the number we use the place of (x).


function cos(x)


Used to calculate the cosine value of the number we use the place of (x).


function tan(x)


This function is used to calculate the tangent of the number we use in the place of (x).