From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 85F98469719 for ; Mon, 24 Feb 2020 20:57:32 +0300 (MSK) Date: Mon, 24 Feb 2020 20:57:31 +0300 From: Kirill Yukhin Message-ID: <20200224175731.q2yuapyikxmimwre@tarantool.org> References: <2b1afed1b05757c177b2fbb2efbf7643670c43cc.1582466958.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2b1afed1b05757c177b2fbb2efbf7643670c43cc.1582466958.git.v.shpilevoy@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 1/1] tuple: don't truncate float in :update() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org 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