[Proj] Arbitrary precision floating point library

Charles Karney charles.karney at sri.com
Mon Apr 23 14:08:53 PDT 2018


On Linux computers you can get angstrom accuracy with long doubles (with
a 64-bit fraction).  Programming carefully, you can get 20 nanometer
accuracy with doubles.

The big challenge is tracking down all those places where unacceptable
round-off errors have crept in.  Here having access to a high precision
library is invaluable.  In the C++ world, this is made easy because all
the mathematical operators and functions can be overloaded to invoke the
high precision routines, so minimal changes to your source code are
necessary.  I use boost's quadmath and MFPR when testing GeographicLib.
See

   https://geographiclib.sourceforge.io/html/highprec.html

On 04/23/18 16:52, Even Rouault wrote:
> Hi,
> 
> In case we'd need angström accuracy someday, I just came accross
> 
> https://bellard.org/libbf/
> 
> " LibBF is a small library to handle arbitrary precision floating point 
> numbers. Its compiled size is about 60 KB of x86 code and has no 
> dependency on other libraries. [...] Easy to embed (a few C files need 
> to be copied). [...] MIT license."
> 
> I didn't try it, but the credibility of its author, Fabrice Bellard, is 
> enormous : https://en.wikipedia.org/wiki/Fabrice_Bellard
> 
> Even
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj

-- 
Charles Karney <charles at karney.com>
702 Prospect Ave, Princeton, NJ 08540-4037

Tel: +1 609 497 4662 (H)
      +1 609 734 2312 (W)



More information about the Proj mailing list