Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 502 Bytes

README.md

File metadata and controls

35 lines (23 loc) · 502 Bytes

intover

Golang package for integer arithmetic with overflow detection.

Based on overflow package.

Features:

  • Generics.
  • Small and simple API.
  • Can return ok or can panic.

Installation

go get github.com/orsinium-labs/intover

Usage

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))