decimal
decimal copied to clipboard
Arbitrary-precision fixed-point decimal numbers in Go
[we](https://github.com/alpacahq) use this decimal library at production and it works really well for last a few years. The only minor complain is that some times (during profiling) we noticed that...
I noticed a number of known values are generated every time you run a trig. function (but not all of them). Wouldn't it be more efficient if all known values...
There is so much in the file decimal.go. Could the trigonometry and marshaling methods be put into separate files?
I'm curious why BigInt method uses string representation: ```go // BigInt returns integer component of the decimal as a BigInt. func (d Decimal) BigInt() *big.Int { scaledD := d.rescale(0) i...
I import decimal third-party packages(url:github.com/shopspring/decimal), in the field to an entity defines the amount of decimal. The decimal type (chart 1), save the amount fields to mongo database when no...
In my opinion, in the case of high concurrency, if i modify it, it may cause thread safety problems. Why not design it as a local variable?
``` func NewFromFloat(value float64) Decimal { if value == 0 { return New(0, 0) } return newFromFloat(value, math.Float64bits(value), &float64info) } func newFromFloat(val float64, bits uint64, flt *floatInfo) Decimal { if...
This library currently supports only the dot `.` as a decimal separator. Unfortunately there is not a standard for this (see [here](https://en.m.wikipedia.org/wiki/Decimal_separator) for example). The comma `,` for example, is...