Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Error converting back to double...

Subject: CGAL users discussion list

List archive

[cgal-discuss] Error converting back to double...


Chronological Thread 
  • From: Ben Supnik <>
  • To:
  • Subject: [cgal-discuss] Error converting back to double...
  • Date: Tue, 14 Apr 2009 21:23:17 -0400

Hi Y'all,

I am using a kernel based on

Simple_cartesian<lazy_exact_nt<Quotient<MP_Float> > >

I make an exact-predicates triangulation where every finite vertex is inside an axis-aligned bounding box with integer corners.

Here's the part I don't understand:

- If I compare every vertex to this bounding box (promoting the bounding box from double to my kernel numeric type) every point is within or on the box.

- If I convert my coordinates to_double, those doubles sometimes are outside the box by rounding error.

What's particularly weird is that
- CGAL tells me that the points that "go outside" the box are EXACTLY on the AABB edge and
- Since the AABB edge is "integral" (e.g. -117.0, 34.0 -> -116.0, 35.0) they should be exactly representable in a IEEE double.

I see from the manual that to_double is an approximation...what is the right way to get a conversion back to double that will be exact when exactness is possible?

cheers
ben


--
Scenery Home Page: http://scenery.x-plane.com/
Scenery blog: http://xplanescenery.blogspot.com/
Plugin SDK: http://www.xsquawkbox.net/xpsdk/
X-Plane Wiki: http://wiki.x-plane.com/
Scenery mailing list:

Developer mailing list:



  • [cgal-discuss] Error converting back to double..., Ben Supnik, 04/15/2009

Archive powered by MHonArc 2.6.16.

Top of Page