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: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Convert CGAL::Lazy_exact_nt<CGAL::Gmpq> to Double
  • Date: Wed, 21 Oct 2009 17:20:18 +0200


Note that there is also to_interval so that you can see how
good the to_double is.

andreas


Matthew Denno wrote:
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) < <mailto:>> 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) <
>
>


<mailto:>>
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