decimal

package
v1.18.6 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: Apache-2.0 Imports: 2 Imported by: 11

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) (v int64, e 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