C++ Math exp()Last Updated : 17 Mar 2025 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 request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India