Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] how to understand CGAL's computational accuracy

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] how to understand CGAL's computational accuracy


Chronological Thread 
  • From: Sebastien Loriot <>
  • To:
  • Subject: Re: [cgal-discuss] how to understand CGAL's computational accuracy
  • Date: Fri, 12 Mar 2021 13:54:19 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-hdrordr: A9a23:O3T7tagKd7XwP65yvb5+oHvEGHBQX9x13DAbvn1ZSRFFG/GwvcaogfgdyFvQgDEeRHkvlbm7SdS9aFnb8oN45pRUAKyrWxPotHDtAIZp64bjxDOIIVyDysd206B8f69iTODhFFQSt7eB3CCUMfYFhOOG/qehmPvEwx5WJz1CRql8425Ce2CmO2JsQg0uP+tcKLO94Y59qyOkaTAraK2AdwI4dszig/GOq578ex4BAHccmXGzpBel8qTzHRTd/jp2aUIp/Z4Y/WLIkxP068yY2pnRqiP07GPd449bn9Hs0LJ4damxo/MYNyn2jUKQbJlhMofigBkOvOqt5Fw2+eO8wCsIAsIb0QKyQkiIuxf3nyHv3DEygkWSsGOwsD/MpYjcSCghA8RMwbhFegbUgnBNgPhMlIxM2Wydu957LzPl2B786d/BSg1wmiOPzEYKoKo8iXpQVIdbUrtNtMgk+l9PGptoJk3HwbFiK+VlAMHC6Ps+Sz2nU0w=
  • Ironport-phdr: A9a23:s3tzbxbgrBg5NFKL/T4LPsz/LTFm14qcDmYuwqpisKpHd+GZx7+nAna3zctkgFKBZ4jH8fUM07OQ7/mxHzVauN3d6TgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrqQjdrNQajZV/Jqo+xRbFv2ZDdvhLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PWwt68LlqRfMTQ2U5nsBSW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/mlE5dWQ90F67CWCJGDmPm6O/h70aHdIeATKw9O2NpxsuLK68MYdrs3w0ueQ==

If you use std::cout << std::setprecision(17) << p << " " << q << " " << r << "\n"; in both cases you will see that the input are different.

you will have:
0 0.29999999999999999 1 0.59999999999999998 2 0.90000000000000002
not collinear
0 0.30000000000000004 1 0.60000000000000009 2 0.89999999999999991
collinear

So the input are different, nothing specific to CGAL.

Best,

Sebastien.


On 3/12/21 1:45 PM, Aomandeyi ( via cgal-discuss Mailing List) wrote:
I still couldn't understand the official explanations,the two sets of data is
exactly the same ,
why the results is different? can someone talk about his own understanding?
the codes as follow
-------------------------------------------------------

--------------------------------------------------------------------------------

#include <iostream>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <sstream>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
int main()
{
Point_2 p(0, 0.3), q(1, 0.6), r(2, 0.9);
{
std::cout << (CGAL::collinear(p, q, r) ? "collinear\n" : "not
collinear\n");
}

{
std::istringstream input("0 0.3 1 0.6 2 0.9");
input >> p >> q >> r;
std::cout << (CGAL::collinear(p, q, r) ? "collinear\n" : "not
collinear\n");
}

return 0;
}
-------------------------------------------------------------------



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/




Archive powered by MHonArc 2.6.19+.

Top of Page