Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] point lying over a line problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] point lying over a line problem


Chronological Thread 
  • From: "Fernando Cacciola" <>
  • To: <>
  • Subject: Re: [cgal-discuss] point lying over a line problem
  • Date: Wed, 23 Jul 2008 17:36:59 -0300
  • Organization: Geometry Factory

Alejandro Aragon wrote:
Oh, and for your information, the precision(20) that you suggested is
stupid because you're way beyond the precision for that type

numeric_limits<double>::digits10 is 15 in a typical implementation, so I wouldn't say 20 is way beyond that.

Also, according to this paper:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2005.pdf

17 would be a reasonable precision for outputing double values in decimal
format

, so you're basically outputting garbage.

What makes you think that using more decimal digits than minimally required results in garbage??

Try this for yourself:

double d = ( 1.0 / 3.0 ) + numeric_limits<double>::epsilon() ;

cout.precision(numeric_limits<double>::digits10); cout << d << endl ;
cout.precision(20); cout << d << endl ;
cout.precision(40); cout << d << endl ;
cout.precision(200); cout << d << endl ;

Finally: did you understand that your point IS NOT really on the line because the actual coordinates are not exactly the same as the decimal literals you used to initialized them?

Best

Fernando Cacciola
www.geometryfactory.com






Archive powered by MHonArc 2.6.16.

Top of Page