- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
expm1() in C++
The function expm1() is used to calculate the exponential raised to the power of any number minus one. It returns the value of (exponential raised to the power of a) - 1.
Here is the mathematical expression of expm1(),
expm1(a) = (e^a) - 1
Here is the syntax of expm1() in C++ language,
float expm1(variable_name);
Here,
variable_name − Any name given to the variable whose value is calculated.
Here is an example of expm1() in C++ language,
Example
#include <iostream> #include <cmath> using namespace std; int main() { int x = 10; float y = 8.28; cout << "The value of x : " << expm1(x); cout << "\nThe value of y : " << expm1(y); return 0; }
Output
Here is the output
The value of x : 22025.5 The value of y : 3943.19
Advertisements