D21495: Use MPFR in knumber_float in order to improve floating-point precision

Christoph Feck noreply at phabricator.kde.org
Thu May 30 18:54:39 BST 2019


cfeck added inline comments.

INLINE COMMENTS

> config-kcalc.h.cmake:28
> +
> +#define HAVE_LONG_DOUBLE 1

This is already present in line 20.

> knumber.cpp:212
>      // Need to transform decimal digits into binary digits
>      const unsigned long int bin_prec = static_cast<unsigned long int>(double(precision) * M_LN10 / M_LN2 + 1);
> +#ifdef KNUMBER_USE_MPFR

I had to increase it by one more binary digit to get `ln(e) == 1` (tested with 20 and 30 decimal digits).

REPOSITORY
  R353 KCalc

REVISION DETAIL
  https://phabricator.kde.org/D21495

To: marcelomariano, cfeck, teran
Cc: kde-utils-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20190530/1ae42b96/attachment.html>


More information about the Kde-utils-devel mailing list