Categorygithub.com/sdcoffey/big
modulepackage
0.7.0
Repository: https://github.com/sdcoffey/big.git
Documentation: pkg.go.dev

# README

BIG

Big is a simple, immuatable wrapper around golang's built-in *big.Float type desinged to offer a more user-friendly API and immutability guarantees at the cost of some runtime performance.

Example

Usage is dead simple:

dec := big.NewDecimal(1.24)
addend := big.NewDecimal(3.14)

dec.Add(addend).String() // prints "4.38"

# Functions

MaxSlice returns the max of a slice of decimals.
MinSlice returns the min of a slice of decimals.
NewDecimal creates a new Decimal type from a float value.
NewFromInt creates a new Decimal type from an int value.
NewFromString creates a new Decimal type from a string value.

# Variables

MarshalQuoted - can toggle this to true to marshal values as strings.
NaN == Not a Number.
ONE == 1.
TEN == 10.
ZERO == 0.

# Structs

Decimal is the main exported type.