MCPcopy Index your code
hub / github.com/ericlagergren/decimal

github.com/ericlagergren/decimal @v3.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.4.0 ↗ · + Follow
551 symbols 2,579 edges 56 files 279 documented · 51% 4 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

decimal Build Status GoDoc

decimal implements arbitrary precision, decimal floating-point numbers, per the General Decimal Arithmetic specification.

Features

  • Useful zero values. The zero value of a decimal.Big is 0, just like math/big.

  • Multiple operating modes. Different operating modes allow you to tailor the package's behavior to your needs. The GDA mode strictly implements the GDA specification, while the Go mode implements familiar Go idioms.

  • High performance. decimal is consistently one of the fastest arbitrary-precision decimal floating-point libraries, regardless of language.

  • An extensive math library. The math/ subpackage implements elementary and trigonometric functions, continued fractions, and more.

  • A familiar, idiomatic API. decimal's API follows math/big's API, so there isn't a steep learning curve.

Installation

go get github.com/ericlagergren/decimal

Documentation

GoDoc

Versioning

decimal uses Semantic Versioning. The current version is 3.3.1.

decimal only explicitly supports the two most recent major Go 1.X versions.

License

BSD 3-clause

Extension points exported contracts — how you extend this code

Generator (Interface)
Generator represents a continued fraction. [4 implementers]
continued_frac.go
SplitFunc (FuncType)
SplitFunc returns the intermediate value for a given n. The returned decimal must not be modified by the caller and may
binary_spliting.go
Contexter (Interface)
Contexter allows Generators to provide a different Context than z's. It's intended to be analogous to the relationship b [4 …
continued_frac.go
Walliser (Interface)
Okay, I _am_ sorry about the name of this interface. It's stupid. Walliser is analogous to Lentzer, except it's for the [4 …
continued_frac.go
Lentzer (Interface)
Lentzer, if implemented, allows Generators to provide their own backing storage for the Lentz function. [3 implementers]
continued_frac.go

Core symbols most depended-on inside this repo

SetUint64
called by 115
big.go
SetString
called by 95
big.go
get
called by 82
const.go
Mul
called by 68
big.go
Precision
called by 60
big.go
validate
called by 57
big.go
Copy
called by 52
big.go
Mul
called by 51
big_ctx.go

Shape

Function 255
Method 253
Struct 26
TypeAlias 11
Interface 5
FuncType 1

Languages

Go98%
Python2%

Modules by API surface

big.go96 symbols
big_ctx.go91 symbols
big_test.go50 symbols
math/math.go21 symbols
internal/arith/arith.go21 symbols
format.go19 symbols
pytables_test.go18 symbols
continued_frac.go17 symbols
issues_test.go15 symbols
util.go14 symbols
misc/misc.go14 symbols
context.go14 symbols

For agents

$ claude mcp add decimal \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact