exact_rep.py 文件源码

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

项目:drmad 作者: bigaidream-projects 项目源码 文件源码
def float_to_rational(self, a):
        assert np.all(a > 0.0)
        d = 2**16 / np.fix(a+1).astype(int) # Uglier than it used to be: np.int(a + 1)
        n = np.fix(a * d + 1).astype(int)
        return  n, d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号