fixedpoint

package
v0.12.0-beta1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 4 Imported by: 3 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Fix64Factor = 100_000_000
View Source
const Fix64Scale uint = 8
View Source
const Fix64TypeMaxFractional = math.MaxInt64 % Fix64Factor
View Source
const Fix64TypeMaxInt = math.MaxInt64 / Fix64Factor
View Source
const Fix64TypeMinFractional = math.MinInt64 % Fix64Factor
View Source
const Fix64TypeMinInt = math.MinInt64 / Fix64Factor
View Source
const UFix64TypeMaxFractional = math.MaxUint64 % uint64(Fix64Factor)
View Source
const UFix64TypeMaxInt = math.MaxUint64 / uint64(Fix64Factor)
View Source
const UFix64TypeMinFractional = 0
View Source
const UFix64TypeMinInt = 0

Variables

View Source
var Fix64TypeMaxFractionalBig = new(big.Int).SetInt64(Fix64TypeMaxFractional)
View Source
var Fix64TypeMaxIntBig = new(big.Int).SetInt64(Fix64TypeMaxInt)
View Source
var Fix64TypeMinFractionalBig = new(big.Int).SetInt64(Fix64TypeMinFractional)
View Source
var Fix64TypeMinIntBig = new(big.Int).SetInt64(Fix64TypeMinInt)
View Source
var UFix64TypeMaxFractionalBig = new(big.Int).SetUint64(UFix64TypeMaxFractional)
View Source
var UFix64TypeMaxIntBig = new(big.Int).SetUint64(UFix64TypeMaxInt)
View Source
var UFix64TypeMinFractionalBig = new(big.Int).SetUint64(UFix64TypeMinFractional)
View Source
var UFix64TypeMinIntBig = new(big.Int).SetUint64(UFix64TypeMinInt)

Functions

func CheckRange

func CheckRange(
	negative bool,
	unsignedIntegerValue, fractionalValue,
	minInt, minFractional,
	maxInt, maxFractional *big.Int,
) bool

func ConvertToFixedPointBigInt

func ConvertToFixedPointBigInt(
	negative bool,
	unsignedInteger *big.Int,
	fractional *big.Int,
	scale uint,
	targetScale uint,
) *big.Int

func NewFix64

func NewFix64(
	negative bool,
	unsignedInteger *big.Int,
	fractional *big.Int,
	parsedScale uint,
) (
	*big.Int,
	error,
)

func NewUFix64

func NewUFix64(
	unsignedInteger *big.Int,
	fractional *big.Int,
	parsedScale uint,
) (
	*big.Int,
	error,
)

func ParseFix64

func ParseFix64(s string) (*big.Int, error)

func ParseUFix64

func ParseUFix64(s string) (*big.Int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL