Skip to Content.
Sympa Menu

cgal-discuss - Re: Re: [cgal-discuss] good or bad triangulations?

Subject: CGAL users discussion list

List archive

Re: Re: [cgal-discuss] good or bad triangulations?


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: Re: [cgal-discuss] good or bad triangulations?
  • Date: Mon, 23 Jan 2012 13:08:27 +0100
  • Organization: GeometryFactory

Le lundi 23 janvier 2012 11:59:55 Daniel Duque a écrit :
> Hi,
>
> > p4x = 0.20000000000000001;
> > p4y = 0.40000000000000002;
> > p4z = 0.40000000000000002;
> >
> > In this example these points are not in plane with axis aligned normal
> > vectors, so How Can I do exactly coplanar this points? (How Daliel says)
>
> I would simply round up the last digit, or two --- a quick and dirty
> solution, I know.

What do you expect? In memory, doubles are in base 2, and not in base 10.

For example, run and compile the following:

#include <iostream>
int main() {
std::cerr.precision(20);
std::cerr << 0.2 << std::endl;
}


You will see that the value 0.2, in memory, is a value more close to
0.2000000000000000111 than 0.2.

The value 0.2, that is 1/5, cannot be represented exactly floating point
numbers or finite 2-adic numbers.

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/




Archive powered by MHonArc 2.6.16.

Top of Page