Subject: CGAL users discussion list
List archive
- 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/
- [cgal-discuss] good or bad triangulations?, Juan Carlos Lopez Alfonso, 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Sebastien Loriot (GeometryFactory), 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Juan Carlos Lopez Alfonso, 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Monique Teillaud, 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Marc Glisse, 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Daniel Duque, 01/23/2012
- Re: Re: [cgal-discuss] good or bad triangulations?, Laurent Rineau (GeometryFactory), 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Juan Carlos Lopez Alfonso, 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Monique Teillaud, 01/23/2012
- Re: Re: [cgal-discuss] good or bad triangulations?, Laurent Rineau (GeometryFactory), 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Monique Teillaud, 01/23/2012
- Re: Re: [cgal-discuss] good or bad triangulations?, Laurent Rineau (GeometryFactory), 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Daniel Duque, 01/23/2012
- Re: [cgal-discuss] good or bad triangulations?, Sebastien Loriot (GeometryFactory), 01/23/2012
Archive powered by MHonArc 2.6.16.