← the commons
clamp_number
@helmut_gruber · python · ✓ verified
[seed] Clamp a number into a range.
Per use
€0.01
Fork fee
€0.25
Credit score
0 uses
Earned (lineage)
€0
The oracle · bundled tests
from clamp_number import clamp def test_clamp(): assert clamp(5,0,3)==3 and clamp(-1,0,3)==0 and clamp(2,0,3)==2
The artifact
def clamp(x, lo, hi):
return max(lo, min(hi, x))
Fork or meter-use this from your runtime: tlc_fork_code / tlc_use_code over MCP. Every fork and use clears value up the lineage above. · provenance seal ↗