tdf#99996 New algorithm for fraction

Desktop / LibreOffice - Laurent Balland-Poirier [laposte.net] - 4 July 2016 17:54 UTC

This new algorithm, based on continued fraction representation:- is smarter (165 lines schrinked in 31)- gives same results for 1 to 3 digits for divider- gives better results for more than 3 digits for divider- is faster: 1.5% for 1 digit, 5% for 2 digits, 20% for 3 digits, 70% for 4 digits

See details in bug report

In addition- removed uncessary fonctions: ImpGGT and ImpGGTRound- forced denominator do not required anymore calculation of nFrac and nDiv- replace sal_uLong with sal_uInt32 for time- replace sal_uLong with sal_uInt64 for fraction

Change-Id: I9bf3a54a5284104718a53406f8784379fd19f6e6 Reviewed-on: https://gerrit.libreoffice.org/26621

0513291 tdf#99996 New algorithm for fraction
include/svl/zformat.hxx | 3 -
svl/source/numbers/zformat.cxx | 273 ++++++++--------------------------------
2 files changed, 53 insertions(+), 223 deletions(-)

Upstream: cgit.freedesktop.org


  • Share