C++ Math cosh()30 Aug 2024 | 1 min read The function finds the hyperbolic cosine of an angle given in radian. Mathematically, coshx = ex+ e-x/2 SyntaxSuppose the hyperbolic angle is 'x': Parameterx: The value of angle whose hyperbolic cosine is to be calculated. Return valueIt returns the hyperbolic cosine of angle given in radian. Example 1Let's see a simple example when the value of x is of integral type. Output: Value of degree is :45 cosh(radian): 1.32426 In this example, cosh() computes the hyperbolic cosine of an angle 45 and returns the value 1.324. Example 2Let's see another simple example. Output: Value of degree is: 25.5 cosh(radian): 1.10058 Next TopicC++ Math Functions |
math exp() function
C++ Math exp() The function computes the exponential e raised to the power given number. Suppose a number is x: exp() = ex Syntax Consider a number 'x'. Syntax would be: float exp(float x); double exp(double x); long double exp(long double x); double exp(integral x); Parameter x: The value whose exponential value is to be calculated. Return value It...
1 min read
math fabs() function
C++ Math fabs() It computes the absolute value of a given number. Suppose a number is 'x': fabs(x) = |x|; Syntax float fabs(float x); double fabs(double x); int fabs(int x); Parameter x: The value whose absolute value is to be determined. Return value It returns the absolute value of x. Example 1 Let's see the simple example...
1 min read
math fmod() function
C++ Math fmod() The function finds the floating point remainder of numerator/denominator and rounded towards zero. Formula of fmod: fmod= numerator - t*denominator where 't' is the truncated value of numerator/denominator. Syntax Consider a numerator 'n' and denominator 'd'. Syntax would be: double fmod(double n,double d); Parameter n:The value of numerator. d:The value of denominator Return value It...
2 min read
math pow() function
C++ Math pow() This function is used to find the power of a given number. Consider a base 'b' and exponent 'e'. Power=be Syntax Its syntax would be : double pow(double b, double e); float pow(float b, float e); long double pow(long double b, long double e); promoted pow(type1 b, type2 e); Note: If...
1 min read
math expm1() function
C++ Math expm1() The function computes the exponential 'e' raised to the power a given number minus 1. Suppose a number is 'x' expm1(x) = e<sup>x</sup> - 1; Syntax float expm1(float x); double expm1(double x); long double expm1(long double x); double expm1(integral x); Note: The return_type can be float, double or long double. Parameter x: It...
1 min read
math erfc() function
C++ Math erfc() The erfc() function computes the complementary error function value of a parameter passed to the function. Suppose a number is 'x': erfc(x) = 1-erf(x); Syntax float erfc(float x) ; double erfc(double x) ; long double erfc(long double x) ; double erfc(integral x); Parameter x: It is a floating point value. Return value It returns the...
2 min read
math fdim() function
C++ Math fdim() The function calculates the positive difference between two numbers. Conditions : Consider two numbers 'x' and 'y' : If(x>y): It returns (x-y); If(y>x): It returns zero. Syntax float fdim(float x, float y); double fdim(double x, double y); long double fdim(long double x, long double y); promoted fdim(Arithmetic x, Arithmetic y); Note: If any argument...
2 min read
math log1p() function
C++ Math log1p() The function computes the natural logarithm of a given number plus one. Suppose a number is 'x': log1p(x) = log(1+x); Syntax float log1p(float x); double log1p(double x); long double log1p(long double x); double log1p(integral x); Note: The return_type can be float, double or long double. Parameter x: The value of which logarithm is to...
2 min read
math fmax() function
C++ Math fmax() The function returns the maximum value between two numbers. Conditions: Consider two numbers 'x' and 'y'. If(x>y): It returns x. If(y>x): It returns y. if (x=nan): It returns y. if (y=nan): It returns x. Syntax float fmax(float x, float y); double fmax(double x, double y); long double fmax(long double x, long double y); promoted fmax(Arithmetic...
1 min read
math logb() function
C++ Math logb() The function computes the logarithm of a given number, using FLT_RADX as base for the logarithm. Generally, FLT_RADX is equal to 2. Therefore, logb() is equivalent to log2(). Syntax Suppose a number is 'x'. Syntax would be: float logb(float x); double logb(double x); long double logb(long double x); double logb(integral x); Parameter x:...
2 min read
We request you to subscribe our newsletter for upcoming updates.

We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India