Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Convert CGAL::Lazy_exact_nt<CGAL::Gmpq> to Double

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Convert CGAL::Lazy_exact_nt<CGAL::Gmpq> to Double


Chronological Thread 
  • From: Matthew Denno <>
  • To:
  • Subject: Re: [cgal-discuss] Convert CGAL::Lazy_exact_nt<CGAL::Gmpq> to Double
  • Date: Wed, 21 Oct 2009 10:06:20 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=OdTF9oVpEwunRDaOs6+kBYl+lUi8XmgpbfQRAfpw3eIUaEpbBUt0RawNOyaHG42EGa s0hbr3Q7A1ZR2x+r7TT6cQGmayQXvyEqIIp6XlID4+HhJH+QsvaVCZgrhps4QY3Nvo8e 280tezqfD4lofo6aVRKGw5QVEQwmo69waSiRg=

Thanks for the clarification.  I figured that once I convert my results to double precision for output to shapefile they will no longer be exact.  I need the intermediate results to be exact so that my algorithms work properly, but think that converting to an approximate solution just before writing the output will be okay.

On Wed, Oct 21, 2009 at 9:47 AM, Laurent Rineau (GeometryFactory) <> wrote:
On Wednesday 21 October 2009 15:41:03 Matthew Denno wrote:
> Ah, perfect!  Thank you.
>
> On Wed, Oct 21, 2009 at 9:33 AM, Laurent Rineau (GeometryFactory) <
>
> > wrote:
> > On Wednesday 21 October 2009 15:11:47 Matthew Denno wrote:
> > > 1) Is there a way to convert a CGAL::Lazy_exact_nt<CGAL::Gmpq> value to
> > > double precision so that I can write to results out to a shapefile?
> >
> > As for that question, use CGAL::to_double
> >
> > http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Algebraic_foundations
> >_ref/Function_to_double.html

I send the mail too quickly. Be aware that the "conversion" done by
CGAL::to_double might not be exact. If you convert a CGAL::Gmpq or a
CGAL::Lazy_exact_nt<CGAL::Gmpq>, the CGAL::to_double function template returns
an approximation of the number, with the best precision possible with the type
"double".

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss




Archive powered by MHonArc 2.6.16.

Top of Page