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

Cast ints as floats? #33

Closed
alainchau opened this issue Nov 15, 2019 · 2 comments · Fixed by #34
Closed

Cast ints as floats? #33

alainchau opened this issue Nov 15, 2019 · 2 comments · Fixed by #34

Comments

@alainchau
Copy link

I forgot to use floats instead of ints and stumbled upon the following:

a = Point(0, 0)
b = Point(1, 1)
l = Line(a, b)

orientation(l, Point(0, 0))
# 0

orientation(l, Point(0, 0.))
# 1

orientation(l, Point(2, 2))
# -1

Should it give a warning/error when given ints?

@dkarrasch
Copy link
Collaborator

Would this #22 (comment) help solve the problem? The result of Point with two Ints is probably far from what you would expect when interpreting the arguments as Cartesian coordinates.

@alainchau
Copy link
Author

Agree, that would be a nice change!

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 a pull request may close this issue.

2 participants