From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 15 Aug 2019 01:26:39 +0300 From: Konstantin Osipov Subject: Re: [PATCH v2 7/8] decimal: add conversions to (u)int64_t Message-ID: <20190814222639.GH28533@atlas> References: <20190812213914.GJ32337@atlas> <999C425D-CF87-4D4D-B31D-F350C99EE8A6@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <999C425D-CF87-4D4D-B31D-F350C99EE8A6@tarantool.org> To: Serge Petrenko Cc: Vladimir Davydov , tarantool-patches@freelists.org List-ID: * Serge Petrenko [19/08/13 17:20]: > > Why do you think it's the best hint option? Why not keep 2-5 decimal > > digits in a hint, as most currencies use? Would it slow down the > > hing making process? You call decimalRescale anyway, it seems. > > It wouldn’t slow down hint calculation (timing difference is tiny). > It will slow down decimal comparison with doubles and integers, though. > > We will get faster comparison for decimals that differ in first 2-5 fractional > digits at the cost of having to cast every double and int to decimal for comparison > with decimals. > Is this worth it? Please ask yourself this. How often do you think you will compare a decimal with another decimal, compared to a decimal with a float? > > Is decimalRescale optimized to be a no-op if there is no need to > > rescale? > > Yes Thanks. -- Konstantin Osipov, Moscow, Russia