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

mathlib Limits move radians/degrees to template header #9102

Merged
merged 1 commit into from
Mar 19, 2018

Conversation

dagar
Copy link
Member

@dagar dagar commented Mar 19, 2018

No description provided.

template<typename T>
constexpr T radians(const T degrees)
{
return (degrees / static_cast<T>(180)) * static_cast<T>(M_PI);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the bracketing, so that the compiler can reduce it to a single multiplication?
degrees * (static_cast<T>(M_PI) / static_cast<T>(180))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dagar dagar merged commit e63f9d9 into master Mar 19, 2018
@dagar dagar deleted the pr-mathlib_limits branch March 19, 2018 16:45
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

Successfully merging this pull request may close these issues.

2 participants