decimal

package
v1.34.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendDecimalToFloat

func AppendDecimalToFloat(dst []float64, va []int64, e int16) []float64

AppendDecimalToFloat converts each item in va to f=v*10^e, appends it to dst and returns the resulting dst.

func AppendFloatToDecimal

func AppendFloatToDecimal(dst []int64, src []float64) (va []int64, e int16)

AppendFloatToDecimal converts each item in src to v*10^e and appends each v to dst returning it as va.

It tries minimizing each item in dst.

func CalibrateScale

func CalibrateScale(a []int64, ae int16, b []int64, be int16) (e int16)

CalibrateScale calibrates a and b with the corresponding exponents ae, be and returns the resulting exponent e.

func ExtendFloat64sCapacity

func ExtendFloat64sCapacity(dst []float64, additionalItems int) []float64

ExtendFloat64sCapacity extends dst capacity to hold additionalItems and returns the extended dst.

func ExtendInt64sCapacity

func ExtendInt64sCapacity(dst []int64, additionalItems int) []int64

ExtendInt64sCapacity extends dst capacity to hold additionalItems and returns the extended dst.

func FromFloat

func FromFloat(f float64) (int64, int16)

FromFloat converts f to v*10^e.

It tries minimizing v. For instance, for f = -1.234 it returns v = -1234, e = -3.

FromFloat doesn't work properly with NaN values, so don't pass them here.

func ToFloat

func ToFloat(v int64, e int16) float64

ToFloat returns f=v*10^e.

Types

This section is empty.

Jump to

Keyboard shortcuts

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