相关疑难解决方法(0)

这个Python函数解决三次方程有什么问题?

我正在使用Python 2和维基百科文章"Cubic函数"中给出的相当简单的方法.这也可能是我必须定义的立方根函数的问题,以便创建标题中提到的函数.

# Cube root and cubic equation solver
#
# Copyright (c) 2013 user2330618
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://www.mozilla.org/MPL/2.0/.

from __future__ import division
import cmath
from cmath import log, sqrt

def cbrt(x):
    """Computes the cube root of a number."""
    if x.imag != 0:
        return cmath.exp(log(x) / …
Run Code Online (Sandbox Code Playgroud)

python math cubic

3
推荐指数
1
解决办法
2451
查看次数

标签 统计

cubic ×1

math ×1

python ×1