<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">My bad, issue and branch are below.<div class=""><a href="https://github.com/tarantool/tarantool/issues/692" class="">https://github.com/tarantool/tarantool/issues/692</a><br class=""><a href="https://github.com/tarantool/tarantool/tree/sp/gh-692-mp-encode-decimal" class="">https://github.com/tarantool/tarantool/tree/sp/gh-692-mp-encode-decimal</a></div><div class=""><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>--</div><div>Serge Petrenko</div><div><a href="mailto:sergepetrenko@tarantool.org" class="">sergepetrenko@tarantool.org</a></div><div class=""><br class=""></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">

</div>
<div style=""><br class=""><blockquote type="cite" class=""><div class="">11 июня 2019 г., в 18:56, Serge Petrenko <<a href="mailto:sergepetrenko@tarantool.org" class="">sergepetrenko@tarantool.org</a>> написал(а):</div><br class="Apple-interchange-newline"><div class=""><div class="">This patchset adds a new type, decimal fixed-point, to tarantool,<br class="">together with methods to pack/unpack decimals, arithmetic operations<br class="">ad math functions.<br class=""><br class="">The first patch adds decNumber library as a submodule.<br class=""><br class="">The second patch adds a small wrapper to the library to make it work<br class="">with fixed-point decimal values, and adds a unit test.<br class="">To evaluate number precision and scale from exponent and the amount of<br class="">significant digits the following formulas are applied:<br class="">If exponent < 0 then precision = MAX(digits, -exponent) and scale = -exponent<br class="">If exponent > 0 then precision = digits + exponent, and scale = 0<br class=""><br class="">Changes in v4:<br class=""> - review fixes as per review<br class="">   from @locker.<br class=""> - remove patches 3 and 4,<br class="">   add decimal_pack/unpack as<br class="">   a preparation for patches<br class="">   4 and 4 to patch 2.<br class=""><br class="">Changes in v3:<br class=""> - add patches 3 and 4 to<br class="">   encode/decode decimals<br class="">   as msgpack.<br class=""><br class="">Changes in v2:<br class=""> - get rid of explicit precision and scale,<br class="">   evaluate them from decNumber digits and exponent.<br class=""> - decimal is now an alias for decNumber<br class=""> - ln, log10, exp, sqrt, pow now accept precision to<br class="">   which the result should be rounded.<br class=""><br class="">Serge Petrenko (2):<br class="">  third-party: add decNumber library<br class="">  lib/core: introduce decimal type to tarantool<br class=""><br class=""> .gitmodules                 |   3 +<br class=""> CMakeLists.txt              |   7 +<br class=""> cmake/BuildDecNumber.cmake  |  14 ++<br class=""> src/CMakeLists.txt          |   1 +<br class=""> src/lib/core/CMakeLists.txt |   3 +-<br class=""> src/lib/core/decimal.c      | 354 +++++++++++++++++++++++++++++++<br class=""> src/lib/core/decimal.h      | 206 ++++++++++++++++++<br class=""> test/unit/CMakeLists.txt    |   2 +<br class=""> test/unit/decimal.c         | 174 ++++++++++++++++<br class=""> test/unit/decimal.result    | 406 ++++++++++++++++++++++++++++++++++++<br class=""> third_party/decNumber       |   1 +<br class=""> 11 files changed, 1170 insertions(+), 1 deletion(-)<br class=""> create mode 100644 cmake/BuildDecNumber.cmake<br class=""> create mode 100644 src/lib/core/decimal.c<br class=""> create mode 100644 src/lib/core/decimal.h<br class=""> create mode 100644 test/unit/decimal.c<br class=""> create mode 100644 test/unit/decimal.result<br class=""> create mode 160000 third_party/decNumber<br class=""><br class="">-- <br class="">2.20.1 (Apple Git-117)<br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>