From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 25 Jul 2019 02:17:30 +0300 From: Konstantin Osipov Subject: Re: [tarantool-patches] [PATCH 5/5] decimal: allow to index decimals Message-ID: <20190724231730.GE15185@atlas> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com, Serge Petrenko List-ID: * Serge Petrenko [19/07/17 18:34]: > + * Max and min decimal numbers whose integral parts fit > + * in a hint value. > + */ > +static const decimal_t HINT_VALUE_DECIMAL_MAX = { > + 18, /* decimal digits */ > + 0, /* exponent */ > + 0, /* no special bits. */ > + {487, 423, 303, 752, 460, 576} /* 576,460,752,303,423,488 = 2^59 - 1 */ > + /* 59 == HINT_VALUE_BITS - 1 */ > +}; I don't get the comments here, could you please expand? > +static const decimal_t HINT_VALUE_DECIMAL_MIN = { > + 18, /* decimal digits */ > + 0, /* exponent */ > + 0x80, /* negative bit */ > + {488, 423, 303, 752, 460, 576} /* 576,460,752,303,423,488 = 2^59 */ Same here, some magic numbers, which don't match each other. > +}; -- Konstantin Osipov, Moscow, Russia