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

p2t::Point inequility operator is wrong #38

Closed
GoogleCodeExporter opened this issue Oct 24, 2015 · 4 comments
Closed

p2t::Point inequility operator is wrong #38

GoogleCodeExporter opened this issue Oct 24, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

In the current version (from repository), the != operator is written as follows 
(line 267 in common/shapes.h):

inline bool operator !=(const Point& a, const Point& b)
{
  return a.x != b.x && a.y != b.y;
}

It's not very consistent with the behaviour of == operator:

inline bool operator ==(const Point& a, const Point& b)
{
  return a.x == b.x && a.y == b.y;
}

The inequility should be !(a == b).

Original issue reported on code.google.com by e...@multitou.ch on 13 Jan 2012 at 1:27

@GoogleCodeExporter
Copy link
Author

a.x != b.x || a.y != b.y maybe?

Original comment by makc.the...@gmail.com on 13 Feb 2012 at 3:45

@GoogleCodeExporter
Copy link
Author

Is there a problem with the algorithm returning incorrect results?

Original comment by mason.gr...@gmail.com on 4 Apr 2012 at 1:20

@GoogleCodeExporter
Copy link
Author

I don't think the operator is used at all by the library, so no. I just noticed 
the error when I wrote some tests myself and used the operator.

Original comment by e...@multitou.ch on 4 Apr 2012 at 4:10

@GoogleCodeExporter
Copy link
Author

Original comment by mason.gr...@gmail.com on 2 May 2013 at 1:41

  • Changed state: Fixed

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

No branches or pull requests

1 participant