You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go has a math.MaxFloat64 but no math.NegativeFloat64 because it's trivial to write -math.MaxFloat64. Should the decimal library similarly avoid defining negative versions of a bunch of constants?
The main counterargument is that decimal.Max64().Neg() isn't quite as neat and it requires a computation on each use, whereas defining as a constant means it can be computed once at program initialisation time.
The text was updated successfully, but these errors were encountered:
Go has a
math.MaxFloat64
but nomath.NegativeFloat64
because it's trivial to write-math.MaxFloat64
. Should the decimal library similarly avoid defining negative versions of a bunch of constants?The main counterargument is that
decimal.Max64().Neg()
isn't quite as neat and it requires a computation on each use, whereas defining as a constant means it can be computed once at program initialisation time.The text was updated successfully, but these errors were encountered: