当前位置: 首页>>代码示例>>Python>>正文


Python Interprete.calcul_exact方法代码示例

本文整理汇总了Python中wxgeometrie.mathlib.interprete.Interprete.calcul_exact方法的典型用法代码示例。如果您正苦于以下问题:Python Interprete.calcul_exact方法的具体用法?Python Interprete.calcul_exact怎么用?Python Interprete.calcul_exact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxgeometrie.mathlib.interprete.Interprete的用法示例。


在下文中一共展示了Interprete.calcul_exact方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_issue_259

# 需要导入模块: from wxgeometrie.mathlib.interprete import Interprete [as 别名]
# 或者: from wxgeometrie.mathlib.interprete.Interprete import calcul_exact [as 别名]
def test_issue_259():
    i = Interprete(verbose=VERBOSE)
    # First part.
    r, l = i.evaluer("normal(140,1 ; 150,3 ; 100 ; 5)")
    # sympy 1.0 : '5,28725822993202*10^-16'
    # Wofram Alpha (01/05/2016) : 5/9007199254740992~~5.55112×10^-16
    # On teste que ce soit en gros correct, sans se focaliser sur les décimales.
    assert re.match("5,[0-9]+\*10\^\-16$", r)
    assert re.match(r"\$5,[0-9]+[ ]\\cdot[ ]10\^{-16}\$$", l)
    # Second part of the issue (scientific notation handling).
    i.calcul_exact = False
    r, l = i.evaluer("10,0^-125,0")
    assertEqual(r, "1,0*10^-125")
    assertEqual(l, r"$10^{-125}$")
开发者ID:wxgeo,项目名称:geophar,代码行数:16,代码来源:test_interprete.py


注:本文中的wxgeometrie.mathlib.interprete.Interprete.calcul_exact方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。