feat: PLANNING体系首版(00路线图/02任务总表/03执行协议/I-03/I-04/registry42口径)+M1止血交付
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""迷你计算库 —— dim4 fixture(已修复版本,供自检使用)。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def add(a: float, b: float) -> float:
|
||||
return a + b
|
||||
|
||||
|
||||
def div(a: float, b: float) -> float:
|
||||
if b == 0:
|
||||
raise ValueError("divisor must not be zero")
|
||||
return a / b
|
||||
|
||||
|
||||
def average(values: list[float]) -> float:
|
||||
if not values:
|
||||
return 0.0
|
||||
return sum(values) / len(values)
|
||||
|
||||
|
||||
def clamp(value: float, lo: float, hi: float) -> float:
|
||||
if value < lo:
|
||||
return lo
|
||||
if value > hi:
|
||||
return hi
|
||||
return value
|
||||
Reference in New Issue
Block a user