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

Constant<T>.Pi requires GreaterThanOrEqual to be defined #55

Closed
WhiteBlackGoose opened this issue Jul 18, 2020 · 2 comments
Closed

Constant<T>.Pi requires GreaterThanOrEqual to be defined #55

WhiteBlackGoose opened this issue Jul 18, 2020 · 2 comments
Labels
Bug issues that suggest a flaw with existing code

Comments

@WhiteBlackGoose
Copy link
Contributor

WhiteBlackGoose commented Jul 18, 2020

To be precise, in this line

pi = Maximum(pi, Constant<T>.Three);

It's better to first check whether the class has this operator defined, it's obviously unnecessary for this line, but it's called when Constant.One is called.

My solution is presented in #56, but I don't think it fits the code quality requirements

@WhiteBlackGoose WhiteBlackGoose added the Bug issues that suggest a flaw with existing code label Jul 18, 2020
@ZacharyPatten
Copy link
Owner

There is still more that will need to be done to the ComputePi method... But I went ahead and converted it to a property along with all the members of Constant. Using fields was faster than properties, but I've determined there are better ways to handle optimizations than worrying about the members of Constant being fields.

@WhiteBlackGoose
Copy link
Contributor Author

It's a matter of a few nanoseconds, I don't think it's a big issue for those who use c#.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug issues that suggest a flaw with existing code
Projects
None yet
Development

No branches or pull requests

2 participants