Spaces:
Running
Running
| def safe_divide(a: float, b: float) -> float: | |
| """Divide a by b; only return inf for division by zero.""" | |
| try: | |
| return a / b | |
| except Exception: | |
| # BUG: catches unrelated errors too broadly. | |
| return float("inf") | |