Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Both double and float parameters were passed to atan2(), which didn't match any variants of atan2()
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3ab0a13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why exactly is the explicit cast to double required here? It should do that implicitly.
3ab0a13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because MSVC doesn't implicitely cast in that case.
3ab0a13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really a great explanation :-P. What does it complain about exactly?
3ab0a13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It complains because it knows atan2(double, double) and atan2(float, float) and don't know what to decide.
3ab0a13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error thrown is:
error C2666: 'atan2': 3 overloads have similar conversions
MSVC doesn't promote floats to doubles, thus it can't find an atan2 overload that contains both a double and a float parameter