[Tarantool-patches] [PATCH 1/1] tuple: don't truncate float in :update()
Kirill Yukhin
kyukhin at tarantool.org
Mon Feb 24 20:57:31 MSK 2020
Hello,
On 23 фев 15:11, Vladislav Shpilevoy wrote:
> Before the patch there were the rules:
> * float +/- double = double
> * double +/- double = double
> * float +/- float = float
>
> The rules were applied regardless of values. That led to a problem
> when float + float exceeding maximal float value could fit into
> double, but was stored as an infinity.
>
> The patch makes so that if a floating point arithmetic operation
> result fits into float, it is stored as float. Otherwise as
> double. Regardless of initial types.
>
> This alongside saves some memory for cases when doubles can be
> stored as floats, and therefore takes 4 less bytes. Although
> these cases are rare, because any not integer value stored in a
> double may have a long garbage tail in its fraction.
>
> Closes #4701
>
> (cherry picked from commit fef4fdfc3edee39c72f2e93e6f96ab681750617f)
> ---
> Branch: https://github.com/tarantool/tarantool/tree/gerold103/gh-4701-update-float-2.2
> Issue: https://github.com/tarantool/tarantool/issues/4701
I've checked your patch into 1.10 and 2.2. I've also changed MS
of the issue to 1.10.
--
Regards, Kirill Yukhin
More information about the Tarantool-patches
mailing list