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

Coerce int range filter values for accuracy and rename some methods for clarity #53

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ryanrdoherty
Copy link
Member

Main goal here is to make sure passed integer range filter values don't produce results (i.e. not filter) values outside the range, even if the values passed are floating point. Important to note that range filters are inclusive! Thus, for example, a passed range filter of [4.5, 6.5] should result in integer conversions of [5, 6] so we don't include 4s or 7s. To do this, we use floor on max values and ceil on min values. Unlike truncation (which we were doing before via longValue()), which does mirror-image conversion for negative numbers, floor and ceil are consistent so we don't need special logic for negative values.

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