https://github.com/ryanavella/fixed
Fixed Point Integers for Go
https://github.com/ryanavella/fixed
fixed-point go golang integer integers
Last synced: 10 months ago
JSON representation
Fixed Point Integers for Go
- Host: GitHub
- URL: https://github.com/ryanavella/fixed
- Owner: ryanavella
- License: mit
- Created: 2018-11-09T04:49:34.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2019-06-03T03:00:34.000Z (over 6 years ago)
- Last Synced: 2025-01-10T23:20:48.087Z (12 months ago)
- Topics: fixed-point, go, golang, integer, integers
- Language: Go
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-MIT
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://godoc.org/github.com/ryanavella/fixed) [](https://goreportcard.com/report/github.com/ryanavella/fixed) [](https://github.com/ryanavella/fixed/blob/develop/LICENSE-MIT) [](https://github.com/ryanavella/fixed/blob/develop/LICENSE-UNLICENSE)
# Fixed
Fixed point integers for Go.
The following fixed point representations are implemented:
* int32_32
Fixed is free and open source software distributed under the terms of both the MIT License and the Unlicense.
## Installing
```shell
go get github.com/ryanavella/fixed
```
## Usage
```golang
package main
import (
"fmt"
"github.com/ryanavella/fixed/int32_32"
)
func main() {
a := int32_32.FromInt32(-1) // -1
b := int32_32.FromFloat64(1.5) // +1.5
fmt.Println(a+b, a-b, a.Mul(b))
}
```
## Scope
This package is intended for efficient and fast computations (i.e. for scientific and mathematical applications). There are no plans to support applications which require constant-time cryptographic security.
## Contributions
See [contributor guidelines](CONTRIBUTING.md).