[geos-devel] double double

Greg Troxel gdt at lexort.com
Fri Dec 7 19:51:03 PST 2018

Paul Ramsey <pramsey at cleverelephant.ca> writes:

> Mats, what ever happened to:
> https://github.com/libgeos/geos/pull/40
> I'm just coming up against some stuff in the JTS commit log that expects
> double double and I see you've done this work already some years ago, but
> it's not committed that I can see. JTS changed over some code to use DD
> exclusively about a year ago, so this is a case where porting has caught up
> to need.
> Were there any substantial problems w/ your PR? If not I'm "just" going to
> try and rebase it and use it as the basis for going ahead.
> (It seems like the state-of-the-art would eventually be to use the "long
> double" type, which has an implementation in GCC, but does not yet have one
> in clang, in hopes that by being close to the metal we'd eventually also
> start to reap performance gains as the silicon adds instructions to improve
> long double calculations. ???)

I don't follow this last paragraph.

As I understand it, long double is a type defined by C that can be more
precise than double, but doesn't have to be, and on x86 is typically 80
bits.  double double is a technique to use two doubles to get roughly
twice the precision.   I would expect that on many CPUs, long double is
the same as double.

So double double is far more precise than long double always.


More information about the geos-devel mailing list