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

How to deal with non-integer Range limits #81

Open
dloscutoff opened this issue Mar 29, 2024 · 0 comments
Open

How to deal with non-integer Range limits #81

dloscutoff opened this issue Mar 29, 2024 · 0 comments
Labels
brainstorming Less of an issue, more of a place to kick around ideas.

Comments

@dloscutoff
Copy link
Owner

Currently, if you construct a Range from non-integers, both values are truncated to ints. For example, 1.2,3.9 gives the same result as 1,3, and -3.9,-1.2 gives the same result as -3,-1. Is this the desired behavior?

  • Do we always want to convert Range bounds to integers, or would it ever be useful to store a Range object with float bounds (regardless of how that is interpreted)?
    • In Python, you can't have a range with floats, but you can have a slice with floats... not sure what the use cases for that are.
  • Intuitively, it seems like the upper bound should represent "up to but not including"; shouldn't that mean that a Range with an upper bound of 3.9 should include 3, since it's up to but not including 3.9?
@dloscutoff dloscutoff added the brainstorming Less of an issue, more of a place to kick around ideas. label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brainstorming Less of an issue, more of a place to kick around ideas.
Projects
None yet
Development

No branches or pull requests

1 participant