C++ Math expm1()30 Aug 2024 | 1 min read The function computes the exponential 'e' raised to the power a given number minus 1. Suppose a number is 'x'SyntaxNote: The return_type can be float, double or long double.Parameterx: It is the value of the exponent. Return valueIt returns 'e' raised to the power x minus -1. Example 1Let's see a simple example Output: Value of x is : 6 expm1(x) = 402.429 In this example, the value of x is 6. The expm1() function computes 'e' raised to the power 6 minus one. Example 2Let's see another simple example Output: Value of x is : 9.8 expm1(x) = 18032.7 In this example, value of x is 9.8. The expm1() function computes 'e' raised to the power 9.8 minus one. Next TopicC++ Math Functions |
math hypot() function
C++ Vector hypot() This function finds the square root of the sum of the squares of two numbers. It stands for hypotenuse, is used to find the hypotenuse of a right angled triangle. Consider three numbers x,y and z : hypotenuse of a right angle triangle = √x2+y2 distance from...
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 cbrt() function
C++ Math cbrt() This function is used to find the cube root of a given number. Consider a argument 'arg' : Cube root of a number : ∛arg Syntax Syntax would be : double cbrt(double arg); float cbrt(float arg); long double cbrt(long double arg); double cbrt(integral arg); Parameter arg : It is the value of float or...
1 min read
math scalbln() function
C++ Math scalbln() The function computes the product of a given number and FLT_RADX raised to the power of exponent. Suppose a number is 'x' and exponent is 'n': scalbn(x,n) = x * ( FLT_RADX)n Syntax float scalbln(float x, long int n); double scalbln(double x, long int n); long double scalbln(long double x,...
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
math round() function
C++ Math round() This function is used to round off the given value which can be either float or double. For example: round(5.8)= 6; round(-1.1)= -1; Syntax Suppose a number is 'x'. Syntax would be: return_type round(data_type x); Parameter x : The value which can be either float or double. Return value It returns the rounded value...
1 min read
math floor() function
C++ Math floor() It rounds the value to the nearest integer which is not greater than the given value. For example: floor(8.2)=8.0; floor(-8.8)=-9.0; Syntax Suppose a number is 'x'. Syntax would be : double floor(double x); Parameter x : It is the value that rounds to the nearest integer. Return value It returns the value that round...
1 min read
math rint() function
C++ Math rint() The function rounds off the given value to the nearest integer using current rounding mode. The current rounding mode is determined by fesetround(). For example: rint(7.9) = 8; if, fesetround(FE_DOWNWARD) then, rint(7.9) = 7; Syntax Suppose a number 'x'. Syntax would be: return_type rint(data_type x); Note: The return_type can be float, double...
1 min read
math isfinite() function
C++ Math isfinite() The function determines the value whether it is finite or not. It should not be NaN or infinite value. If the number is finite, it returns 1 otherwise 0. Note: A finite value is a value that is neither NAN nor infinite. Syntax Suppose a number is...
2 min read
math nearbyint() function
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
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