Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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