C++ Math pow()30 Aug 2024 | 2 min read This function is used to find the power of a given number. Consider a base 'b' and exponent 'e'.Power=be SyntaxIts syntax would be : Note: If any argument is of long double type, then the return type is promoted to long double. If not, then the return type is promoted to double.Parameterb: 'b' is the number, whose power is to be calculated. e: 'e' is the exponent. Return valueIt returns the base 'b'raised to the power 'e'. Example 1Let's see a simple example when both base and exponent are of integer type. Output: Power of a given number is :16 Example 2Let's see a example when base is of float type and exponent is of integer type. Output: Power of a given number is :64 Example 3Let's see a simple example when both base and exponent are of float type.. Output: Power of a given number is :4 Next TopicC++ Math Functions |
C++ Math islessequal() The islessequal() function checks whether the value of first argument is less than or equal to the second argument. If the value of first argument is less than or equal to the value of second argument, then it returns 1 otherwise 0. Note: If...
2 min read
C++ Math log() The function is used to find the natural logarithm (base-e logarithm) of a given number. Mathematically: Suppose 'x' is a given number: logex = log(x); Syntax float log(float x); double log(double x); long double log(long double x); double log(integral x); Parameter x: It is the value whose natural logarithm is to be calculated. Return...
2 min read
C++ Math nearbyint() The function rounds off the given value to a nearby integral value by using the current rounding method. The current rounding method is described by fegetround. Syntax Suppose a number is 'x'. Syntax would be: return_type nearbyint(data_type x); Note: The return_type can be float, double or long...
1 min read
C++ Math signbit() The function checks whether the sign of a given number is negative or not. If the sign of a number is negative, it returns 1 otherwise 0. The signbit() function can also be applied to infinite, NAN and zero value. Syntax Suppose a number is 'x'.Syntax would...
2 min read
C++ Math cos() The function is used to find the cosine of an angle expressed in terms of radian. Syntax Consider a radian 'x'. Syntax would be: float cos(float x); float cos(double x); float cos(long double x); double cos(integral x); Note: If the value passed is an integer type, then it is cast to...
1 min read
C++ Math isnormal() The function determines that whether the given number is normal or not. If the number is normal, it returns 1 otherwise 0. Syntax Suppose a number is 'x'. Syntax would be: bool isnormal(float x); bool isnormal(double x); bool isnormal(long double x); bool isnormal(integral x); Parameter x: It...
1 min read
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
C++ Math tgamma() The tgamma() function computes the gamma function of an argument passed to the function. Suppose a number is x: Syntax float tgamma(float x); double tgamma(double x); long double tgamma(long double x); double tgamma(double x); Parameter x: It is a floating point value. Return value It returns the gamma function value of x. Parameter Return value x...
2 min read
C++ Math after() The after() function represents the representable value in a specific direction. Suppose two numbers are 'from' and 'to'. Therefore, the after() function finds the value of 'from' in the direction of 'to'. Syntax float after( float from, float to); double after( double from, double to); long double...
2 min read
C++ Math asin() The function computes the inverse sine of a number given in radian. asin(x) = sin-1x Syntax Suppose a number is 'x'. Syntax would be: float asin(float x); double asin(double x); long double asin(long double x); double asin(integral x); Note: If the value passed is an integer type, then it is cast to...
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