go-spacemesh icon indicating copy to clipboard operation
go-spacemesh copied to clipboard

Evaluate fixed-point decimal arithmetic library

Open lrettig opened this issue 3 years ago • 2 comments

Currently we're using a custom solution: https://github.com/spacemeshos/fixed

Consider switching to one of these alternatives:

  • https://github.com/shopspring/decimal
  • https://github.com/ericlagergren/decimal (used in https://github.com/spacemeshos/economics)
  • https://github.com/cockroachdb/apd

See also http://speleotrove.com/decimal/

Related: #3408

lrettig avatar Aug 03 '22 18:08 lrettig

One issue with https://github.com/spacemeshos/fixed is that it's very poorly documented and hence very difficult to understand what's going on

lrettig avatar Aug 03 '22 20:08 lrettig

we don't really need any floating point library

for computing weight in the tortoise fractional numbers are used, so we are not loosing any precision for computing binomial cdf - we can do that using big int with higher precision

dshulyak avatar Aug 04 '22 04:08 dshulyak