Golang package for integer arithmetic with overflow detection.
Based on overflow package.
Features:
- Generics.
- Small and simple API.
- Can return ok or can panic.
go get github.com/orsinium-labs/intover
result, ok := intover.Do(a, '+', b)
Or the same:
result, ok := intover.Add(a, b)
Or if you want it to panic on overflow:
result := intover.Must(intover.Add(a, b))