简体   繁体   English

如何在 python 中写出这个方程?

[英]How to write this equation in python?

I'm trying to write this equation in Python.我试图在 Python 中写出这个等式。 I'm not exactly sure what I'm getting wrong here.我不确定我在这里做错了什么。 Using pow() instead of ** seemed to get closer to the correct answer, which is 0.0000195.使用 pow() 而不是 ** 似乎更接近正确答案,即 0.0000195。 Any help appreciated.任何帮助表示赞赏。

vix ki 方程

from math import e

deltaK = 25
k = 400
r = 0.0038
t = 0.0246575
q = 0.125

deltaK/pow(k, 2) * pow(e, r*t) * q

#output = 1.953308013456722e-05

try尝试

p= deltaK/pow(k, 2) * pow(e, r*t) * q
"{:.8f}".format(float(p))

it will print the answer the way you want it converting scientific to decimal它将以您希望将科学转换为十进制的方式打印答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM