Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orsinium-labs/intover
Golang package for integer arithmetic with overflow detection.
https://github.com/orsinium-labs/intover
arithmetic go golang integer-arithmetic integer-overflow overflow overflow-detection
Last synced: about 2 months ago
JSON representation
Golang package for integer arithmetic with overflow detection.
- Host: GitHub
- URL: https://github.com/orsinium-labs/intover
- Owner: orsinium-labs
- License: mit
- Created: 2023-10-29T08:51:53.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-29T08:52:45.000Z (about 1 year ago)
- Last Synced: 2024-05-01T15:42:34.130Z (8 months ago)
- Topics: arithmetic, go, golang, integer-arithmetic, integer-overflow, overflow, overflow-detection
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# intover
Golang package for integer arithmetic with overflow detection.
Based on [overflow](https://github.com/JohnCGriffin/overflow) package.
Features:
* Generics.
* Small and simple API.
* Can return ok or can panic.## Installation
```bash
go get github.com/orsinium-labs/intover
```## Usage
```go
result, ok := intover.Do(a, '+', b)
```Or the same:
```go
result, ok := intover.Add(a, b)
```Or if you want it to panic on overflow:
```go
result := intover.Must(intover.Add(a, b))
```