hasgo icon indicating copy to clipboard operation
hasgo copied to clipboard

BigNum?

Open DylanMeeus opened this issue 5 years ago • 1 comments

Define a Numbers type which is equal to math/big in Go for arbitrary precision numbers.

DylanMeeus avatar May 18 '19 21:05 DylanMeeus

This would break compatibility with the other number types since we miss method overloading. For example:

var a, b, c int
c = a + b

vs

var a, b, c math.bigInt
c = a.Add(b)

(The actual syntax might vary, but it'd be incompatible with certain functions you'd expect on numbers. And those are the kind of operations you'd expect to work. We could make them work but make them type specific instead of generating them.. that's an option to explore further).

DylanMeeus avatar Jun 06 '19 21:06 DylanMeeus