Skip to content

feat(point): Round Point integerization to be a bit more natural#16

Merged
tirithen merged 1 commit intotirithen:mainfrom
duelafn:rounding
Mar 21, 2025
Merged

feat(point): Round Point integerization to be a bit more natural#16
tirithen merged 1 commit intotirithen:mainfrom
duelafn:rounding

Conversation

@duelafn
Copy link
Contributor

@duelafn duelafn commented Mar 21, 2025

Hello, thanks for an excellent project. Are you open to using rounding rather than truncation when constructing points?

Without rounding, binary precision and truncation makes Point::<Centi>::new(2.05, 2.125) == (204, 212)
With rounding, we get a more natural (205, 213).

Without rounding, binary precision and truncation makes
Point::<Centi>::new(2.05, 2.125) == (204, 212)
With rounding, we get a more natural (205, 213).
Copy link
Owner

@tirithen tirithen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes lots of sense, thank you for the fix!

@tirithen tirithen merged commit b046cad into tirithen:main Mar 21, 2025
7 checks passed
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