কম্পিউটার টিউটোরিয়াল

C++-এ exp() ফাংশন


C/C++ লাইব্রেরি ফাংশন double exp(double x) e-এর x ঘাতের মান রিটার্ন করে। exp() ফাংশন এর ডিক্লেরেশন নিচে দেওয়া হলো।

double exp(double x)

প্যারামিটারটি একটি ফ্লোটিং পয়েন্ট ভ্যালু। এবং এই ফাংশন x-এর এক্সপোনেনশিয়াল ভ্যালু রিটার্ন করে।

উদাহরণ

#include <iostream> #include <cmath> using namespace std; int main () {    double x = 0;    cout << "The exponential value of " << x << " is " << exp(x) << endl;    cout << "The exponential value of " << x+1 << " is " << exp(x+1) <<    endl;       cout << "The exponential value of " << x+2 << " is " << exp(x+2) <<    endl;    return(0); }

আউটপুট

The exponential value of 0 is 1 The exponential value of 1 is 2.71828 The exponential value of 2 is 7.38906

  1. C++-এ পাওয়ার (pow) ফাংশন লিখুন

  2. C++-এ expm1() ফাংশন

  3. C++-এ log1p() ফাংশন

  4. C++-এ swap() ফাংশন