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.
go get github.com/ryanavella/fixed
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))
}
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.