test_libstandard.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:femtocode 作者: diana-hep 项目源码 文件源码
def test_sinh(self):
        self.assertEqual(session.source("Test", x=real(3.14, 6.5)).type("sinh(x)"), real(math.sinh(3.14), math.sinh(6.5)))
        self.assertEqual(session.source("Test", x=real(3.14, almost(6.5))).type("sinh(x)"), real(math.sinh(3.14), almost(math.sinh(6.5))))
        self.assertEqual(session.source("Test", x=real(3.14, almost(inf))).type("sinh(x)"), real(math.sinh(3.14), almost(math.sinh(inf))))
        self.assertEqual(session.source("Test", x=real(3.14, inf)).type("sinh(x)"), real(math.sinh(3.14), inf))
        self.assertEqual(session.source("Test", x=real).type("sinh(x)"), real(almost(-inf), almost(inf)))
        self.assertEqual(session.source("Test", x=extended).type("sinh(x)"), real(-inf, inf))
        for entry in numerical.toPython(y = "y", a = "sinh(y)").submit():
            self.assertEqual(entry.a, math.sinh(entry.y))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号