Commit 0051db1
Add zero-division checks to stdMath.percentDelta overloads (#735)
### PR Description
- **What**: Add explicit zero-divisor guards to
`stdMath.percentDelta(uint256,uint256)` and
`stdMath.percentDelta(int256,int256)`.
- **Why**: Prevents runtime division-by-zero and makes failure mode
explicit and predictable.
- **How**: Added `require` checks with a concise error message and brief
comments.
---------
Co-authored-by: zerosnacks <[email protected]>
Co-authored-by: zerosnacks <[email protected]>1 parent a8f2815 commit 0051db1
2 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
0 commit comments