gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source.
https://gno.land/
Other
882 stars 364 forks source link

bigdec and bigint in gno ?? #650

Closed r3v4s closed 1 year ago

r3v4s commented 1 year ago

Description

Since go (and perhaps plus gno) supports 64bit as maximum value for representing integer and float, I think math/big is one necessary thing in gno.

While debugging some codes, I found PR #306 and it looks like @jaekwon is trying to implment similar thing by supporting bigdec and bigtint types as native type for gno.

bigint was defined https://github.com/gnolang/gno/blob/master/pkgs/gnolang/uverse.go#L112, but bigdec hasn't.

There is few things I'm having trouble with figuring it out.

  1. Does bigdec has definiation code (which I couldn't found)
  2. Can I convert native int64/uint64/float64 to bigint
r3v4s commented 1 year ago

1) Found 2) Implemented