C++ Math lgamma()30 Aug 2024 | 2 min read The lgamma() function computes the logarithm of a gamma function of an argument passed to the function. Suppose a number is x: ![]() SyntaxParameterx: It is a floating point value. Return valueIt returns the logarithm of a gamma function of value x.
Example 1Let's see the simple example when the value of x is 2. Output: Value of x is : 2 lgamma(x) :0 In the above example, the value of x is 2. Therefore, the function lgamma() returns 0 value. Example 2Let's see the simple example when the value of x is 0. Output: Value of x is : 0 lgamma(x) : inf In the above example, the value of x is zero. Therefore, the function lgamma() returns +∞. Example 3Let's see the simple example when the value of x is a negative integer. Output: Value of x is : -5 lgamma(x) : inf In the above example, the value of x is a negative integer. Therefore, the function lgamma() returns +∞. Example 4Let's see the simple example when the value of x is nan. Output: Value of x is : -nan lgamma(x) :-nan In the above example, the value of x is nan. Therefore, the function lgamma() returns nan. 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 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 tanh() function
C++ Math tanh() The function computes the hyperbolic tangent of an angle given in radian. Mathematically, tanhx = ex -e-x/ ex+e-x Syntax Suppose the angle is 'x': float tanh(float x); double tanh(double x); long double tanh(long double x); double tanh(integral x); Parameter x: The value whose hyperbolic tangent is to be computed. Return value It returns the hyperbolic tangent...
1 min read
math asinh() function
C++ Math asinh() The function computes the arc hyperbolic sine of an angle given in radian. Where, an arc of hyperbolic sine is the inverse of hyperbolic sine. sinh-1x = asinh(x); Syntax Suppose an angle given in radian is 'x': float asinh(float x); double asinh(double x); long double asinh(long double x); double asinh(integral x); Parameter x: The...
1 min read
math fma() function
C++ Math fma() The function computes the expression x*y+z without losing its precision in any intermediate result. Suppose numbers are x,y and z: fma(x,y,z) = x*y+z; Syntax float fma(float x, float y, float z); double fma(double x, double y, double z); long double fma(long double x, long double y, long double z); double fma(type1...
1 min read
math isunordered() function
C++ Math isunordered() The isunordered() function checks whether the value of first argument can be meaningfully compared with the second argument. If the first argument cannot be meaningfully compared with the second argument (i.e one or both are NAN), it return 1 otherwise 0. Syntax Consider two numbers 'x'...
1 min read
math islessgreater() function
C++ Math islessgreater() The islessgreater() fuinction determines whether the value of first argument is less than or greater than the value of second argument. If the value of first argument is less than or greater than the second argument then it returns 1 otherwise 0. Note: If one...
2 min read
math isgreater() function
C++ Math isgreater() The isgreater() function determines whether the value of first argument given in function is greater than the value of second argument. If the first number is greater, it returns 1 otherwise 0. Note: If one or both the arguments of a function are NAN then...
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 isnan() function
C++ Math isnan() The function checks whether the number is a Not a Number or not. If the number is NaN, it returns 1 otherwise 0. Note: The NaN is a non-representable value for floating point elements such as square root of negative number or the result of...
1 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
