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

How should I handle consts? #95

Open
DrAlta opened this issue Nov 11, 2023 · 1 comment
Open

How should I handle consts? #95

DrAlta opened this issue Nov 11, 2023 · 1 comment

Comments

@DrAlta
Copy link
Contributor

DrAlta commented Nov 11, 2023

Hi, I'm adding trigonometric functions as I need them for my project. Since try_into() isn't allowed in consts and I can't think of any other way to do different values for them My current approach is to have a Consts trait with an impl for GeneralFraction, GeneralFraction, GeneralFraction and so on then I made a Trigametric trait which requires the Consts trait.

I currently just have atan() and atan2() you can view my work in the trigonometrics branch of my fork

@dnsl48
Copy link
Owner

dnsl48 commented Nov 13, 2023

Hi @DrAlta.
Yes, that makes sense. That is not something we could have unified for all derived types.
E.g. BigFraction, which has infinite precision, can't possibly have a meaningful implementation for Consts trait.
I would also try choosing a more self-descriptive name for the Consts trait, which could imply the flavour of the consts it contains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants