TypeError: 'float' object is not callable/unknown error/no exp

TypeError: 'float' object is not callable/unknown error/no exp

我正在尝试使用梯形规则对正态分布函数进行数值积分:

import math as m
def f(x):
    N(x)
    return x

def N(x):
    x=((2*m.pi)**-(1/2))*m.e(-(1/2)*x**2)
    return x

def trap(a, b, n):
    h = float(b - a) / n
    t = 0.0
    for i in range(1, n):
        t += f(a + i*h)
    t += (f(a)+f(b))/2.0
    return t * h

n=int(raw_input("the value of n is:"))
a=int(raw_input("the value of a is:"))
b=int(raw_input("the value of b is:"))


print(trap(a,b,n))

但是,当我尝试调用

x=((2*m.pi)**-(1/2))*m.e(-(1/2)*x**2)

我在 N 的 行 15 中得到以下错误:

TypeError: 'float' object is not callable

math.e 是常量 2.71...它是一个浮点数而不是可调用的。指数函数是math.exp