Sub32to64WithOverflow returns a-b. If ok is false, b was outside the int32 range or a-b overflowed.
(a int32, b int64)
| 71 | // Sub32to64WithOverflow returns a-b. If ok is false, b was outside the |
| 72 | // int32 range or a-b overflowed. |
| 73 | func Sub32to64WithOverflow(a int32, b int64) (r int32, ok bool) { |
| 74 | if b > math.MaxInt32 || b < math.MinInt32 { |
| 75 | return 0, false |
| 76 | } |
| 77 | return Sub32WithOverflow(a, int32(b)) |
| 78 | } |
| 79 | |
| 80 | // Sub32WithOverflow returns a-b. If ok is false, a-b overflowed. |
| 81 | func Sub32WithOverflow(a, b int32) (r int32, ok bool) { |
no test coverage detected