Replies: 1 comment
-
Your C++ compiler already rounds 99.999999999999995 to 100 (type |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I encountered an issue with snap rounding in CGAL when inserting two line segments to be snap rounded. In my case, the horizontal line is slightly slanted, where the starting point and ending point are different by a very small value. When the ending point is 99.99999999999995 (14dp), the output of snap rounding is
(0.5, 100.5), (100.5, 99.5)
, where the two points lie on different y-axes. However, when the ending point is 99.999999999999995 (15dp), they lie on the same y-axis(0.5, 100.5), (100.5, 100.5)
. I tried to resolve the issue by replacing the Kernel type withCGAL::Exact_predicates_exact_constructions_kernel
to make the geometric computations in the code exact. Unfortunately, this did not solve the issue.Any explanations why this could be the case? My understanding is that regardless of whether it’s 15dp or 14dp, they should always be located in the same hot pixel, because a hot pixel must start and end at 0 and 1. Which is what makes the behavior especially puzzling.
Source Code
Beta Was this translation helpful? Give feedback.
All reactions