zoukankan      html  css  js  c++  java
  • log() exp()函数

    1 对数函数表示法

    import numpy as np
    import math
    print('输出自然底数e:',math.e)
    
    # np表示法
    # np.log()是以e为底的自然对数
    print(np.log(math.e))
    # np.log10是以10为底的对数函数  这种写法只可表示底为2和10的对数函数
    print(np.log10(10))
    # np.log1p()表示ln(1+x)
    print(np.log1p(math.e-1))
    
    # math表示法
    # 任意的对数函数表示方法,第一个数是幂,第二个是底数
    print(math.log(64, 2))
    View Code

     参考:https://www.runoob.com/python/func-number-log.html

    2 指数函数表示法

    import numpy as np
    import math
    
    # np表示法
    # np.exp()是以e为底的自然对数
    print(np.exp(1))
    # np.expm1()表示exp(x)-1,输入的可以是普通数字也可以是数组
    print(np.expm1(1))
    
    # math表示法
    print(math.exp(1))
    # 任意的对数函数表示方法,第一个数是底数,第二个是指数
    print(math.pow(2,6))
    View Code

    参考:https://www.runoob.com/python/func-number-exp.html

              https://blog.csdn.net/jhjbjbn/article/details/44776089

  • 相关阅读:
    win8.1下安装双系统ubuntu14.04.3
    如何使用cmd
    My Test about Mat
    访问Mat矩阵中的元素并为其赋值
    Mat代码操作
    waitKey()
    ASCII码对照表
    vector 中的clear()
    vector 介绍
    Mat的详解
  • 原文地址:https://www.cnblogs.com/xxswkl/p/11684849.html
Copyright © 2011-2022 走看看