helpers.py 文件源码

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

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def normalize(tstamp):
    # Get fractional adjustment from whole seconds
    fadj, tstamp.twsec = math.modf(tstamp.twsec)

    # Adjust fractional seconds and get whole seconds adjustment
    tstamp.tfsec, wadj = math.modf(tstamp.tfsec + fadj)

    # If fractional seconds are negative, borrow a second from the whole
    # seconds to make it positive, normalizing to [0,1)
    if (tstamp.tfsec < 0.0):
        tstamp.tfsec += 1.0;
        wadj -= 1.0;

    tstamp.twsec += wadj;
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号