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;
评论列表
文章目录