Home > Backend Development > Python Tutorial > Detailed explanation of exp() function tutorial in Python

Detailed explanation of exp() function tutorial in Python

零下一度
Release: 2017-05-24 13:36:40
Original
6337 people have browsed it

Python exp() function

Description

exp() function returns the exponent of x,

Grammar

import mathmath.exp(x)
Copy after login

Note: exp() cannot be accessed directly. You need to import the math module and call this method through staticobject.

Parameters

Return value

Return the exponent of x

Instance

# -*- coding: UTF-8 -*-import math   # 导入 math 模块print "math.exp(2) : ", math.exp(2)print "math.exp(100.12) : ", math.exp(100.12)print "math.exp(100.72) : ", math.exp(100.72)print "math.exp(119L) : ", math.exp(119L)print "math.exp(math.pi) : ", math.exp(math.pi)
Copy after login

Output:

math.exp(2) :  7.38905609893math.exp(100.12) :  3.03084361407e+43math.exp(100.72) :  5.52255713025e+43math.exp(119L) :  4.7978133273e+51math.exp(math.pi) :  23.1406926328
Copy after login

Python exp( ) Function

Description

exp() function returns the exponent of x,

Syntax

import mathmath.exp(x)
Copy after login

Note: exp() cannot be accessed directly. You need to import the math module and call this method through a static object.

Parameters

  • x Numeric expression

Return value

Return the index of x

Instance

# -*- coding: UTF-8 -*-import math   # 导入 math 模块print "math.exp(2) : ", math.exp(2)print "math.exp(100.12) : ", math.exp(100.12)print "math.exp(100.72) : ", math.exp(100.72)print "math.exp(119L) : ", math.exp(119L)print "math.exp(math.pi) : ", math.exp(math.pi)
Copy after login

Output:

math.exp(2) :  7.38905609893math.exp(100.12) :  3.03084361407e+43math.exp(100.72) :  5.52255713025e+43math.exp(119L) :  4.7978133273e+51math.exp(math.pi) :  23.1406926328
Copy after login

[Related recommendations]

1. Share an example tutorial on the exp() method used to calculate the index in Python

2. Share an example tutorial on using python to write poc and exp

The above is the detailed content of Detailed explanation of exp() function tutorial in Python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template