apd
apd copied to clipboard
Arbitrary-precision decimals for Go
Looks like `Quantize(result, amount, 0)` func works differently for: - when `amount` is of the form `N.0*` (where N is integer number and N != 0) - when `amount` is...
I've been using the lib with a precision of 34, and I've noticed that when using `Text()`, some of my decimals terminate with `...9999999` or `..0000001`. I suspect it's got...
This test panics: ```go func TestSetStringMalformed(t *testing.T) { c := &BaseContext d := new(Decimal) tests := []string{ ".-4", ".-400000000000000000000000000000000000000", } for _, test := range tests { _, _, err...
http://www.swarthmore.edu/NatSci/smaurer1/Math6B/Readings/calculatorsParris-rev.pdf is maybe good?
I'm building a financial application that deals with multiple currencies and multiple Contexts with settings appropriate to each currency. The DB storage supports the widest possible range of values to...
Prefer to use Append and allocate scratch space to improve speed and efficiency of string conversion: ``` name old time/op new time/op delta DecimalString-10 147ns ± 1% 56ns ± 4%...
The comment of Decompose specifies that `buf` can be used to fill the coefficient if the size is big enough however the current implementation simply ignores it. This is problematic...
The comment specifies that buf will be used for the coefficient is it provides enough capacity but right now it is ignored which annoying when trying to encode with zero...
Hello, 1. what if I need to inline int256 values, can I just increase `bigint.go:28 const inlineWords` to 256 ? Or it can break some logic ? 2. why if...
When multiplying 0 with some number, the resulting Text('f') shows too many zeroes. I expect the result to return "0" ``` x := new(apd.Decimal) _, _ = x.SetFloat64(0) multiplier :=...