Retoor software development Projects Research SearchXNG
Register Sign In

23 lines
433 B
Python
Raw Normal View History

chore: seed sandbox project
2026-07-25 16:58:41 +02:00
# retoor <retoor@molodetz.nl>
def add(left: int, right: int) -> int:
return left + right
def subtract(left: int, right: int) -> int:
return left - right
feat: add clamp_to_byte at the end of calculator
2026-07-25 19:01:02 +02:00
feat(nadia): Implement clamp function **Outcome:** done **Changed:** src/calculator.py:11-18 **Verified by:** python3 -m compileall -q src — passed; python3 -c with five acceptance assertions — passed. make verify fails because tests/ directory does not exist. **Findings:** clamp(value: int, low: int, high: int) -> int added at src/calculator.py:11 with no docstrings or comments. File header at src/calculator.py:1 is present. All functions use full int type annotations. **Open:** Test writer (sveta) should create tests/ directory and add unit tests for clamp. **Confidence:** high Typosaurus-Run: 5b5c36bf38254bf4bfcdbde317991a5a Typosaurus-Node: bf41377d70c446b1b80b9e058fe81fb8 Typosaurus-Agent: @nadia Refs: #7
2026-07-25 19:00:59 +02:00
def clamp(value: int, low: int, high: int) -> int:
if low > high:
raise ValueError
if value < low:
return low
if value > high:
return high
return value
feat: add clamp_to_byte at the end of calculator
2026-07-25 19:01:02 +02:00
def clamp_to_byte(value: int) -> int:
return max(0, min(255, value))
Reference in New Issue Copy Permalink
078766216d
typosaurus-sandbox/src/calculator.py
Response time: 32ms
Mail Licenses API