cmath.py 文件源码

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

项目:ouroboros 作者: pybee 项目源码 文件源码
def _special_type(x):
    ST_NINF, ST_NEG, ST_NZERO, ST_PZERO, ST_POS, ST_PINF, ST_NAN = range(7)
    if math.isnan(x):
        return ST_NAN
    if math.isfinite(x):
        if x != 0:
            if math.copysign(1, x) == 1:
                return ST_POS
            return ST_NEG
        if math.copysign(1, x) == 1:
            return ST_PZERO
        return ST_NZERO
    if math.copysign(1, x) == 1:
        return ST_PINF
    return ST_NINF
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号