https://github.com/spatialcurrent/go-math
Math functions that support varied types
https://github.com/spatialcurrent/go-math
big-data bigdata data
Last synced: 7 days ago
JSON representation
Math functions that support varied types
- Host: GitHub
- URL: https://github.com/spatialcurrent/go-math
- Owner: spatialcurrent
- License: mit
- Created: 2019-06-15T14:09:37.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2021-11-20T21:08:25.000Z (about 4 years ago)
- Last Synced: 2024-11-17T12:50:16.518Z (about 1 year ago)
- Topics: big-data, bigdata, data
- Language: Go
- Homepage: https://godoc.org/github.com/spatialcurrent/go-math/pkg/math
- Size: 27.3 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://circleci.com/gh/spatialcurrent/go-math/tree/master) [](https://goreportcard.com/report/spatialcurrent/go-math) [](https://godoc.org/github.com/spatialcurrent/go-math) [](https://github.com/spatialcurrent/go-math/blob/master/LICENSE)
# go-math
# Description
**go-math** is a simple library that provides math functions that support varied types, but makes smart decisions to maximize precision and maintain input types. For example, you can sum a slice of ints and floats.
**go-math** can be used in scenarios when you do not know the type of the input data a-priori. For example, a sensor might report altitude as an integer or as a float64.
# Usage
**Go**
You can import **go-math** as a library with:
```go
import (
"github.com/spatialcurrent/go-math/pkg/math"
)
```
See [math](https://godoc.org/github.com/spatialcurrent/go-math/pkg/math) in GoDoc for information on how to use Go API.
# Examples
See the many [examples](https://godoc.org/github.com/spatialcurrent/go-math/pkg/math) in GoDoc or the tests.
# Testing
Run test using `make test` or (`bash scripts/test.sh`), which runs unit tests, `go vet`, `go vet with shadow`, [errcheck](https://github.com/kisielk/errcheck), [ineffassign](https://github.com/gordonklaus/ineffassign), [staticcheck](https://staticcheck.io/), and [misspell](https://github.com/client9/misspell).
# Contributing
[Spatial Current, Inc.](https://spatialcurrent.io) is currently accepting pull requests for this repository. We'd love to have your contributions! Please see [Contributing.md](https://github.com/spatialcurrent/go-math/blob/master/CONTRIBUTING.md) for how to get started.
# License
This work is distributed under the **MIT License**. See **LICENSE** file.