Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefafafan/mathg
A wrapper of Golang's math package to support generic numbers
https://github.com/stefafafan/mathg
golang math mathematics wrapper
Last synced: 16 days ago
JSON representation
A wrapper of Golang's math package to support generic numbers
- Host: GitHub
- URL: https://github.com/stefafafan/mathg
- Owner: stefafafan
- License: mit
- Created: 2022-12-25T10:34:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-25T12:32:57.000Z (about 2 years ago)
- Last Synced: 2024-06-21T03:18:46.204Z (7 months ago)
- Topics: golang, math, mathematics, wrapper
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mathg
A wrapper of [Golang's math package](https://pkg.go.dev/math) to support generic numbers.
Note: Functions in this package just call the math function with the number casted to float64; this package is not well tested and may or may not function as you expect.
## Usage
go get```sh
go get github.com/stefafafan/mathg
```You can use many of the math functions with float32, int64, etc.
```golang
import "github.com/stefafafan/mathg"
func main() {
// int abs
mathg.Abs(123)// float abs
mathg.Abs(123.456)// ...
}
```## Author
stefafafan ([GitHub](https://github.com/stefafafan), [Twitter](https://twitter.com/stefafafan))