https://github.com/andy2046/maths
Max Min for alphanumeric in Go
https://github.com/andy2046/maths
alphanumeric golang max min range ternary
Last synced: 9 months ago
JSON representation
Max Min for alphanumeric in Go
- Host: GitHub
- URL: https://github.com/andy2046/maths
- Owner: andy2046
- License: apache-2.0
- Created: 2018-10-06T06:26:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-07T07:19:50.000Z (over 7 years ago)
- Last Synced: 2025-03-20T23:27:09.866Z (about 1 year ago)
- Topics: alphanumeric, golang, max, min, range, ternary
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# maths
## makes `Max` `Min` easier
Go `math` pkg provides `Max` `Min` only for `float64`, this lib adds on for other types.
[Why does Go not have feature X?](https://golang.org/doc/faq#Why_doesnt_Go_have_feature_X)
### Install
```
go get github.com/andy2046/maths
```
### Usage
```go
func main() {
iSlice := []int{1, 2, 3}
i := IntVar.Max(iSlice...) // 3
i = IntVar.Min(iSlice...) // 1
}
```