test_math_tools.py 文件源码

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

项目:py-prng 作者: czechnology 项目源码 文件源码
def test_incomplete_gamma_sum(self):
        """Test if the sum of lower and upper incomplete gamma functions correctly produce the
        gamma function"""

        rand = Random(372924)
        for _ in range(10):
            a, x = rand.random() * 10, rand.random() * 10
            l = incomplete_gamma_lower(a, x)
            r = incomplete_gamma_upper(a, x)
            g = gamma(a)
            self.assertAlmostEqual(l + r, g, 10)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号