unit.py 文件源码

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

项目:OpenRAM 作者: mguthaus 项目源码 文件源码
def _convert_to(l, dest_unit="m"):
    if type(l) in (types.IntType, types.LongType, types.FloatType):
        return l * _m[_default_unit] * scale['u'] / _m[dest_unit]
    elif not isinstance(l, length): 
        l = length(l)       # convert to length instance if necessary

    return (l.t + l.u*scale['u'] + l.v*scale['v'] + l.w*scale['w'] + l.x*scale['x']) / _m[dest_unit]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号