C++ Math exp()The function computes the exponential e raised to the power given number. Suppose a number is x:exp() = ex SyntaxConsider a number 'x'. Syntax would be: Parameterx: The value whose exponential value is to be calculated. Return valueIt returns the exponential value of type float, double or long double. If value is too large, the function returns HUGE_VAL Example 1Let's see a simple example when the value of x is positive. Output: Value of x is : 0.2 Exponential value of x is : 1.2214 In this example, exp() function calculates the exponential value of x when the value of x is positive. Example 2Let's see a simple example when the value of x is negative Output: Value of x is : -5.3 Exponential value of x is : 0.00499159 In this example, exp() function calculates the exponential value of x when the value of x is negative. Next TopicC++ Math Functions |
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