本文整理匯總了Python中sys.float_info.min方法的典型用法代碼示例。如果您正苦於以下問題:Python float_info.min方法的具體用法?Python float_info.min怎麽用?Python float_info.min使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sys.float_info
的用法示例。
在下文中一共展示了float_info.min方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: from_decimal
# 需要導入模塊: from sys import float_info [as 別名]
# 或者: from sys.float_info import min [as 別名]
def from_decimal(self, _in_decimal_frame):
"""
Convert a decimal representation to a frame time
Note that subframes are always positive, so negative
decimal representations result in an inverted sub frame
and floored frame number
"""
new_frame = math.floor(_in_decimal_frame)
# Ensure fractional parts above the highest sub frame
# float precision do not round to 0.0
fraction = _in_decimal_frame - math.floor(_in_decimal_frame)
# clamp = max(min(value, max_value), min_value)
return FrameTime(new_frame,
max(min(fraction, float_info.max), float_info.min))
示例2: __init__
# 需要導入模塊: from sys import float_info [as 別名]
# 或者: from sys.float_info import min [as 別名]
def __init__(self, bottom=float_info.min,
top=float_info.max,
decimals=float_info.dig, parent=None):
super(MyDoubleValidator, self).__init__(bottom, top, decimals, parent)
示例3: __init__
# 需要導入模塊: from sys import float_info [as 別名]
# 或者: from sys.float_info import min [as 別名]
def __init__(self, pool: 'Pool', epsilon: float = float_info.min):
super().__init__(pool, amount=epsilon)