From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 13 Aug 2019 00:18:38 +0300 From: Konstantin Osipov Subject: Re: [PATCH v2 2/8] decimal: fix encoding numbers with positive exponent. Message-ID: <20190812211838.GD32337@atlas> References: <53d58fa5cad01273d3e60fe034c8e74f023d3c0e.1565263272.git.sergepetrenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53d58fa5cad01273d3e60fe034c8e74f023d3c0e.1565263272.git.sergepetrenko@tarantool.org> To: Serge Petrenko Cc: vdavydov.dev@gmail.com, tarantool-patches@freelists.org List-ID: * Serge Petrenko [19/08/08 14:56]: > When a number having a positive exponent is encoded, the internal > decPackedFromNumber function returns a negative scale, which differs > from the scale, returned by decimal_scale(). This leads to errors in > decoding. Account for negative scale in decimal_pack() and > decimal_unpack(). I don't understand this commit. Why do you use mp_store_u8 + a cast to unsigned, not mp_store_i8/mp_load_i8 without a cast? -- Konstantin Osipov, Moscow, Russia