Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should Neg… constants be removed? #22

Open
anzdaddy opened this issue Feb 3, 2019 · 0 comments
Open

Should Neg… constants be removed? #22

anzdaddy opened this issue Feb 3, 2019 · 0 comments
Labels
🔌 api design Issues related to the design of the API.

Comments

@anzdaddy
Copy link
Member

anzdaddy commented Feb 3, 2019

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.

@anzdaddy anzdaddy added the 🔌 api design Issues related to the design of the API. label Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌 api design Issues related to the design of the API.
Projects
None yet
Development

No branches or pull requests

1 participant