toorop / go-bittrex

Go binding for the Bittrex crypto-currency exchange API.
MIT License
230 stars 101 forks source link

Fix uncertainity with small amounts #40

Closed sharpner closed 6 years ago

sharpner commented 6 years ago

currently most values are not really reliable because they are casted to float64.

For example 0,01905563 + 0,01905697 will yield 0.038113 instead of 0.0381126, which is getting increasingly more important :)

yellowred commented 6 years ago

Can't see uncertainty though: https://play.golang.com/p/taILcmEV0Uy However the example from https://github.com/shopspring/decimal works with loss of precision. Just trying to figure out which float64 calculations are not precise.

sharpner commented 6 years ago

because your example is a bit flawed, see here: https://play.golang.com/p/Kb8r_OtmVz- :)