decimal
decimal copied to clipboard
Add more frequently used built-in variables like `Zero`
Can we add more frequently used built-in variables like
// Zero constant, to make computations faster.
// Zero should never be compared with == or != directly, please use decimal.Equal or decimal.Cmp instead.
var Zero = New(0, 1)
At lease add variables for following
var oneInt = big.NewInt(1)
var twoInt = big.NewInt(2)
var fourInt = big.NewInt(4)
var fiveInt = big.NewInt(5)
var tenInt = big.NewInt(10)
var twentyInt = big.NewInt(20)
// One constant, to make computations faster.
// One should never be compared with == or != directly, please use decimal.Equal or decimal.Cmp instead.
var One = New(1, 0)
// Two constant, to make computations faster.
// Two should never be compared with == or != directly, please use decimal.Equal or decimal.Cmp instead.
var Two = New(2, 0)
......
Consider:
Consider:
I'm sorry, but what does this mean?
Hi @Halimao. Sure I will consider it :D Personally, I would opt for adding just essential constants, to not overload the API surface with unnecessary ones.
Possible duplicate of #103.