From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 19DF16EC55; Thu, 29 Jul 2021 14:52:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 19DF16EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627559573; bh=UHi3Pnq9/NBTFTiBXvy72saWlDYDmd0dAC9W/xAzWCo=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=OpyIDAy+ILJypYP0m9hWNw1Einc+gDFywewESACkPP6Xov7NPj28hBJyRqlIxMN3O Rmd7gaj+0BadOmRWZtKIy4JB3eNIcf7K/NMrnV7Uh4jeVTn+qX4OrJqNcNLIlkjg8G o1kv7q6SJ9jCQ0yipS9TRXeAeugy7INX4lntOFv8= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 76A756EC55 for ; Thu, 29 Jul 2021 14:52:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 76A756EC55 Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1m94ao-0003E5-Gt; Thu, 29 Jul 2021 14:52:51 +0300 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) In-Reply-To: <175f212fc092d0da8e5d773160042db5770fee2e.1627420835.git.v.shpilevoy@tarantool.org> Date: Thu, 29 Jul 2021 14:52:49 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <175f212fc092d0da8e5d773160042db5770fee2e.1627420835.git.v.shpilevoy@tarantool.org> To: Vladislav Shpilevoy X-Mailer: Apple Mail (2.3654.100.0.2.22) X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD941C43E597735A9C354866C15C72ED952BE56FFA0EFAF5B8C182A05F538085040F3FBB0EE7AEE59A3CBBBE60FC8B61DE7A910363EA729DD27FAF5FF8D179A284A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DF2546A43F668C04EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063736D1EC9E169E1F8C8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D82FAEB3E639E99CD91174C7F2B54F1C82117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B8C7ADC89C2F0B2A5A471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C837C4FEFBD186071C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5643EA2779A7F547B35C7F80BD465D092FDB336B602ABBC13D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA753530422897FB34C3410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34524B2D44961BF9C6FB85D5CCF1984AFA3F8BAF9D3982A7FC4C78317FC19256E60EA7BE9317FCF8F81D7E09C32AA3244C5C1876AB842DCD9CC837BB03E5FE9FB6BBA718C7E6A9E042FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojPp/mPgZxawGZjr7q3YELHA== X-Mailru-Sender: 3B9A0136629DC912F4AABCEFC589C81E4620CF77F0B45A180C0A7B6AC80E54FC4C79792403CE3B7AAD07DD1419AC565FA614486B47F28B67C5E079CCF3B0523AED31B7EB2E253A9E112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 4/5] decimal: introduce decimal_to_string X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Ostanevich via Tarantool-patches Reply-To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the patch, my 2 cents below.=20 Otherwise - LGTM. Regards, Sergos > On 28 Jul 2021, at 00:24, Vladislav Shpilevoy = wrote: >=20 > It saves decimal as a string into an externally passed buffer. Please mention decimal_to_string() introduction. > This will be used by places which can not use the static buffer > returned by decimal_str(). >=20 > Part of #6259 > --- > src/lib/core/decimal.c | 8 + > src/lib/core/decimal.h | 12 ++ > test/unit/decimal.c | 5 +- > test/unit/decimal.result | 394 ++++++++++++++++++++------------------- > 4 files changed, 230 insertions(+), 189 deletions(-) >=20 > diff --git a/src/lib/core/decimal.c b/src/lib/core/decimal.c > index 4befbda37..6d2ccb96f 100644 > --- a/src/lib/core/decimal.c > +++ b/src/lib/core/decimal.c > @@ -175,6 +175,14 @@ decimal_str(const decimal_t *dec) > return buf; > } >=20 > +void > +decimal_to_string(const decimal_t *dec, char *str) > +{ > + char *tmp =3D decNumberToString(dec, str); > + assert(str =3D=3D tmp); Why? The decToString() doesn't touch original string pointer, working on a local copy. > + (void)tmp; > +} > + > static decimal_t * > decimal_to_integer(decimal_t *dec) > { > diff --git a/src/lib/core/decimal.h b/src/lib/core/decimal.h > index d2f2dfbdb..aeafd2c68 100644 > --- a/src/lib/core/decimal.h > +++ b/src/lib/core/decimal.h > @@ -42,6 +42,14 @@ > extern "C" { > #endif /* defined(__cplusplus) */ >=20 > +enum { > + /* > + * The documentation in the decnumber sources says the string = needs to > + * be >=3D digit count + 14. > + */ > + DECIMAL_MAX_STR_LEN =3D DECIMAL_MAX_DIGITS + 14, > +}; > + > typedef decNumber decimal_t; >=20 > /** > @@ -128,6 +136,10 @@ decimal_from_uint64(decimal_t *dec, uint64_t = num); > const char * > decimal_str(const decimal_t *dec); >=20 > +/** Write the decimal as a string into the passed buffer. */ > +void > +decimal_to_string(const decimal_t *dec, char *str); > + > /** > * Convert a given decimal to int64_t > * \param[out] num - the result > diff --git a/test/unit/decimal.c b/test/unit/decimal.c > index 756c68518..aea646e15 100644 > --- a/test/unit/decimal.c > +++ b/test/unit/decimal.c > @@ -108,6 +108,9 @@ char buf[32]; > is(decimal_compare(&dec, &d2), 0, "mp_decode(mp_encode("str")) = value");\ > is(decimal_scale(&dec), decimal_scale(&d2), = "mp_decode(mp_encode("str")) scale");\ > is(strcmp(decimal_str(&d2), str), 0, = "str(mp_decode(mp_encode("str"))) =3D=3D "str);\ > + char strbuf[DECIMAL_MAX_STR_LEN + 1];\ > + decimal_to_string(&dec, strbuf);\ > + is(strcmp(strbuf, decimal_str(&dec)), 0, "stack str =3D=3D = static str for "str);\ > b2 =3D buf;\ > int8_t type;\ > uint32_t l2 =3D mp_decode_extl(&b2, &type);\ > @@ -194,7 +197,7 @@ test_pack_unpack(void) > static int > test_mp_decimal(void) > { > - plan(198); > + plan(216); >=20 > test_mpdec("0"); > test_mpdec("-0"); > diff --git a/test/unit/decimal.result b/test/unit/decimal.result > index 8f6de61a7..b7da2d2ce 100644 > --- a/test/unit/decimal.result > +++ b/test/unit/decimal.result > @@ -498,7 +498,7 @@ ok 279 - subtests > ok 150 - unpack malformed decimal fails > ok 151 - decode malformed decimal preserves buffer position > ok 280 - subtests > - 1..198 > + 1..216 > ok 1 - mp_sizeof_decimal(0) > ok 2 - mp_sizeof_decimal(0) =3D=3D len(mp_encode_decimal(0)) > ok 3 - mp_next(mp_encode(0)) > @@ -506,197 +506,215 @@ ok 280 - subtests > ok 5 - mp_decode(mp_encode(0)) value > ok 6 - mp_decode(mp_encode(0)) scale > ok 7 - str(mp_decode(mp_encode(0))) =3D=3D 0 > - ok 8 - mp_ext_type is MP_DECIMAL > - ok 9 - decimal_unpack() after mp_decode_extl() > - ok 10 - decimal_unpack() after mp_decode_extl() value > - ok 11 - decimal_unpack() after mp_decode_extl() len > - ok 12 - mp_sizeof_decimal(-0) > - ok 13 - mp_sizeof_decimal(-0) =3D=3D len(mp_encode_decimal(-0)) > - ok 14 - mp_next(mp_encode(-0)) > - ok 15 - mp_decode(mp_encode(-0) len > - ok 16 - mp_decode(mp_encode(-0)) value > - ok 17 - mp_decode(mp_encode(-0)) scale > - ok 18 - str(mp_decode(mp_encode(-0))) =3D=3D -0 > - ok 19 - mp_ext_type is MP_DECIMAL > - ok 20 - decimal_unpack() after mp_decode_extl() > - ok 21 - decimal_unpack() after mp_decode_extl() value > - ok 22 - decimal_unpack() after mp_decode_extl() len > - ok 23 - mp_sizeof_decimal(1) > - ok 24 - mp_sizeof_decimal(1) =3D=3D len(mp_encode_decimal(1)) > - ok 25 - mp_next(mp_encode(1)) > - ok 26 - mp_decode(mp_encode(1) len > - ok 27 - mp_decode(mp_encode(1)) value > - ok 28 - mp_decode(mp_encode(1)) scale > - ok 29 - str(mp_decode(mp_encode(1))) =3D=3D 1 > - ok 30 - mp_ext_type is MP_DECIMAL > - ok 31 - decimal_unpack() after mp_decode_extl() > - ok 32 - decimal_unpack() after mp_decode_extl() value > - ok 33 - decimal_unpack() after mp_decode_extl() len > - ok 34 - mp_sizeof_decimal(-1) > - ok 35 - mp_sizeof_decimal(-1) =3D=3D len(mp_encode_decimal(-1)) > - ok 36 - mp_next(mp_encode(-1)) > - ok 37 - mp_decode(mp_encode(-1) len > - ok 38 - mp_decode(mp_encode(-1)) value > - ok 39 - mp_decode(mp_encode(-1)) scale > - ok 40 - str(mp_decode(mp_encode(-1))) =3D=3D -1 > - ok 41 - mp_ext_type is MP_DECIMAL > - ok 42 - decimal_unpack() after mp_decode_extl() > - ok 43 - decimal_unpack() after mp_decode_extl() value > - ok 44 - decimal_unpack() after mp_decode_extl() len > - ok 45 - mp_sizeof_decimal(0.1) > - ok 46 - mp_sizeof_decimal(0.1) =3D=3D len(mp_encode_decimal(0.1)) > - ok 47 - mp_next(mp_encode(0.1)) > - ok 48 - mp_decode(mp_encode(0.1) len > - ok 49 - mp_decode(mp_encode(0.1)) value > - ok 50 - mp_decode(mp_encode(0.1)) scale > - ok 51 - str(mp_decode(mp_encode(0.1))) =3D=3D 0.1 > - ok 52 - mp_ext_type is MP_DECIMAL > - ok 53 - decimal_unpack() after mp_decode_extl() > - ok 54 - decimal_unpack() after mp_decode_extl() value > - ok 55 - decimal_unpack() after mp_decode_extl() len > - ok 56 - mp_sizeof_decimal(-0.1) > - ok 57 - mp_sizeof_decimal(-0.1) =3D=3D = len(mp_encode_decimal(-0.1)) > - ok 58 - mp_next(mp_encode(-0.1)) > - ok 59 - mp_decode(mp_encode(-0.1) len > - ok 60 - mp_decode(mp_encode(-0.1)) value > - ok 61 - mp_decode(mp_encode(-0.1)) scale > - ok 62 - str(mp_decode(mp_encode(-0.1))) =3D=3D -0.1 > - ok 63 - mp_ext_type is MP_DECIMAL > - ok 64 - decimal_unpack() after mp_decode_extl() > - ok 65 - decimal_unpack() after mp_decode_extl() value > - ok 66 - decimal_unpack() after mp_decode_extl() len > - ok 67 - mp_sizeof_decimal(2.718281828459045) > - ok 68 - mp_sizeof_decimal(2.718281828459045) =3D=3D = len(mp_encode_decimal(2.718281828459045)) > - ok 69 - mp_next(mp_encode(2.718281828459045)) > - ok 70 - mp_decode(mp_encode(2.718281828459045) len > - ok 71 - mp_decode(mp_encode(2.718281828459045)) value > - ok 72 - mp_decode(mp_encode(2.718281828459045)) scale > - ok 73 - str(mp_decode(mp_encode(2.718281828459045))) =3D=3D = 2.718281828459045 > - ok 74 - mp_ext_type is MP_DECIMAL > - ok 75 - decimal_unpack() after mp_decode_extl() > - ok 76 - decimal_unpack() after mp_decode_extl() value > - ok 77 - decimal_unpack() after mp_decode_extl() len > - ok 78 - mp_sizeof_decimal(-2.718281828459045) > - ok 79 - mp_sizeof_decimal(-2.718281828459045) =3D=3D = len(mp_encode_decimal(-2.718281828459045)) > - ok 80 - mp_next(mp_encode(-2.718281828459045)) > - ok 81 - mp_decode(mp_encode(-2.718281828459045) len > - ok 82 - mp_decode(mp_encode(-2.718281828459045)) value > - ok 83 - mp_decode(mp_encode(-2.718281828459045)) scale > - ok 84 - str(mp_decode(mp_encode(-2.718281828459045))) =3D=3D = -2.718281828459045 > - ok 85 - mp_ext_type is MP_DECIMAL > - ok 86 - decimal_unpack() after mp_decode_extl() > - ok 87 - decimal_unpack() after mp_decode_extl() value > - ok 88 - decimal_unpack() after mp_decode_extl() len > - ok 89 - mp_sizeof_decimal(3.141592653589793) > - ok 90 - mp_sizeof_decimal(3.141592653589793) =3D=3D = len(mp_encode_decimal(3.141592653589793)) > - ok 91 - mp_next(mp_encode(3.141592653589793)) > - ok 92 - mp_decode(mp_encode(3.141592653589793) len > - ok 93 - mp_decode(mp_encode(3.141592653589793)) value > - ok 94 - mp_decode(mp_encode(3.141592653589793)) scale > - ok 95 - str(mp_decode(mp_encode(3.141592653589793))) =3D=3D = 3.141592653589793 > - ok 96 - mp_ext_type is MP_DECIMAL > - ok 97 - decimal_unpack() after mp_decode_extl() > - ok 98 - decimal_unpack() after mp_decode_extl() value > - ok 99 - decimal_unpack() after mp_decode_extl() len > - ok 100 - mp_sizeof_decimal(-3.141592653589793) > - ok 101 - mp_sizeof_decimal(-3.141592653589793) =3D=3D = len(mp_encode_decimal(-3.141592653589793)) > - ok 102 - mp_next(mp_encode(-3.141592653589793)) > - ok 103 - mp_decode(mp_encode(-3.141592653589793) len > - ok 104 - mp_decode(mp_encode(-3.141592653589793)) value > - ok 105 - mp_decode(mp_encode(-3.141592653589793)) scale > - ok 106 - str(mp_decode(mp_encode(-3.141592653589793))) =3D=3D = -3.141592653589793 > - ok 107 - mp_ext_type is MP_DECIMAL > - ok 108 - decimal_unpack() after mp_decode_extl() > - ok 109 - decimal_unpack() after mp_decode_extl() value > - ok 110 - decimal_unpack() after mp_decode_extl() len > - ok 111 - = mp_sizeof_decimal(1234567891234567890.0987654321987654321) > - ok 112 - = mp_sizeof_decimal(1234567891234567890.0987654321987654321) =3D=3D = len(mp_encode_decimal(1234567891234567890.0987654321987654321)) > - ok 113 - = mp_next(mp_encode(1234567891234567890.0987654321987654321)) > - ok 114 - = mp_decode(mp_encode(1234567891234567890.0987654321987654321) len > - ok 115 - = mp_decode(mp_encode(1234567891234567890.0987654321987654321)) value > - ok 116 - = mp_decode(mp_encode(1234567891234567890.0987654321987654321)) scale > - ok 117 - = str(mp_decode(mp_encode(1234567891234567890.0987654321987654321))) =3D=3D = 1234567891234567890.0987654321987654321 > - ok 118 - mp_ext_type is MP_DECIMAL > - ok 119 - decimal_unpack() after mp_decode_extl() > - ok 120 - decimal_unpack() after mp_decode_extl() value > - ok 121 - decimal_unpack() after mp_decode_extl() len > - ok 122 - = mp_sizeof_decimal(-1234567891234567890.0987654321987654321) > - ok 123 - = mp_sizeof_decimal(-1234567891234567890.0987654321987654321) =3D=3D = len(mp_encode_decimal(-1234567891234567890.0987654321987654321)) > - ok 124 - = mp_next(mp_encode(-1234567891234567890.0987654321987654321)) > - ok 125 - = mp_decode(mp_encode(-1234567891234567890.0987654321987654321) len > - ok 126 - = mp_decode(mp_encode(-1234567891234567890.0987654321987654321)) value > - ok 127 - = mp_decode(mp_encode(-1234567891234567890.0987654321987654321)) scale > - ok 128 - = str(mp_decode(mp_encode(-1234567891234567890.0987654321987654321))) =3D=3D= -1234567891234567890.0987654321987654321 > + ok 8 - stack str =3D=3D static str for 0 > + ok 9 - mp_ext_type is MP_DECIMAL > + ok 10 - decimal_unpack() after mp_decode_extl() > + ok 11 - decimal_unpack() after mp_decode_extl() value > + ok 12 - decimal_unpack() after mp_decode_extl() len > + ok 13 - mp_sizeof_decimal(-0) > + ok 14 - mp_sizeof_decimal(-0) =3D=3D len(mp_encode_decimal(-0)) > + ok 15 - mp_next(mp_encode(-0)) > + ok 16 - mp_decode(mp_encode(-0) len > + ok 17 - mp_decode(mp_encode(-0)) value > + ok 18 - mp_decode(mp_encode(-0)) scale > + ok 19 - str(mp_decode(mp_encode(-0))) =3D=3D -0 > + ok 20 - stack str =3D=3D static str for -0 > + ok 21 - mp_ext_type is MP_DECIMAL > + ok 22 - decimal_unpack() after mp_decode_extl() > + ok 23 - decimal_unpack() after mp_decode_extl() value > + ok 24 - decimal_unpack() after mp_decode_extl() len > + ok 25 - mp_sizeof_decimal(1) > + ok 26 - mp_sizeof_decimal(1) =3D=3D len(mp_encode_decimal(1)) > + ok 27 - mp_next(mp_encode(1)) > + ok 28 - mp_decode(mp_encode(1) len > + ok 29 - mp_decode(mp_encode(1)) value > + ok 30 - mp_decode(mp_encode(1)) scale > + ok 31 - str(mp_decode(mp_encode(1))) =3D=3D 1 > + ok 32 - stack str =3D=3D static str for 1 > + ok 33 - mp_ext_type is MP_DECIMAL > + ok 34 - decimal_unpack() after mp_decode_extl() > + ok 35 - decimal_unpack() after mp_decode_extl() value > + ok 36 - decimal_unpack() after mp_decode_extl() len > + ok 37 - mp_sizeof_decimal(-1) > + ok 38 - mp_sizeof_decimal(-1) =3D=3D len(mp_encode_decimal(-1)) > + ok 39 - mp_next(mp_encode(-1)) > + ok 40 - mp_decode(mp_encode(-1) len > + ok 41 - mp_decode(mp_encode(-1)) value > + ok 42 - mp_decode(mp_encode(-1)) scale > + ok 43 - str(mp_decode(mp_encode(-1))) =3D=3D -1 > + ok 44 - stack str =3D=3D static str for -1 > + ok 45 - mp_ext_type is MP_DECIMAL > + ok 46 - decimal_unpack() after mp_decode_extl() > + ok 47 - decimal_unpack() after mp_decode_extl() value > + ok 48 - decimal_unpack() after mp_decode_extl() len > + ok 49 - mp_sizeof_decimal(0.1) > + ok 50 - mp_sizeof_decimal(0.1) =3D=3D len(mp_encode_decimal(0.1)) > + ok 51 - mp_next(mp_encode(0.1)) > + ok 52 - mp_decode(mp_encode(0.1) len > + ok 53 - mp_decode(mp_encode(0.1)) value > + ok 54 - mp_decode(mp_encode(0.1)) scale > + ok 55 - str(mp_decode(mp_encode(0.1))) =3D=3D 0.1 > + ok 56 - stack str =3D=3D static str for 0.1 > + ok 57 - mp_ext_type is MP_DECIMAL > + ok 58 - decimal_unpack() after mp_decode_extl() > + ok 59 - decimal_unpack() after mp_decode_extl() value > + ok 60 - decimal_unpack() after mp_decode_extl() len > + ok 61 - mp_sizeof_decimal(-0.1) > + ok 62 - mp_sizeof_decimal(-0.1) =3D=3D = len(mp_encode_decimal(-0.1)) > + ok 63 - mp_next(mp_encode(-0.1)) > + ok 64 - mp_decode(mp_encode(-0.1) len > + ok 65 - mp_decode(mp_encode(-0.1)) value > + ok 66 - mp_decode(mp_encode(-0.1)) scale > + ok 67 - str(mp_decode(mp_encode(-0.1))) =3D=3D -0.1 > + ok 68 - stack str =3D=3D static str for -0.1 > + ok 69 - mp_ext_type is MP_DECIMAL > + ok 70 - decimal_unpack() after mp_decode_extl() > + ok 71 - decimal_unpack() after mp_decode_extl() value > + ok 72 - decimal_unpack() after mp_decode_extl() len > + ok 73 - mp_sizeof_decimal(2.718281828459045) > + ok 74 - mp_sizeof_decimal(2.718281828459045) =3D=3D = len(mp_encode_decimal(2.718281828459045)) > + ok 75 - mp_next(mp_encode(2.718281828459045)) > + ok 76 - mp_decode(mp_encode(2.718281828459045) len > + ok 77 - mp_decode(mp_encode(2.718281828459045)) value > + ok 78 - mp_decode(mp_encode(2.718281828459045)) scale > + ok 79 - str(mp_decode(mp_encode(2.718281828459045))) =3D=3D = 2.718281828459045 > + ok 80 - stack str =3D=3D static str for 2.718281828459045 > + ok 81 - mp_ext_type is MP_DECIMAL > + ok 82 - decimal_unpack() after mp_decode_extl() > + ok 83 - decimal_unpack() after mp_decode_extl() value > + ok 84 - decimal_unpack() after mp_decode_extl() len > + ok 85 - mp_sizeof_decimal(-2.718281828459045) > + ok 86 - mp_sizeof_decimal(-2.718281828459045) =3D=3D = len(mp_encode_decimal(-2.718281828459045)) > + ok 87 - mp_next(mp_encode(-2.718281828459045)) > + ok 88 - mp_decode(mp_encode(-2.718281828459045) len > + ok 89 - mp_decode(mp_encode(-2.718281828459045)) value > + ok 90 - mp_decode(mp_encode(-2.718281828459045)) scale > + ok 91 - str(mp_decode(mp_encode(-2.718281828459045))) =3D=3D = -2.718281828459045 > + ok 92 - stack str =3D=3D static str for -2.718281828459045 > + ok 93 - mp_ext_type is MP_DECIMAL > + ok 94 - decimal_unpack() after mp_decode_extl() > + ok 95 - decimal_unpack() after mp_decode_extl() value > + ok 96 - decimal_unpack() after mp_decode_extl() len > + ok 97 - mp_sizeof_decimal(3.141592653589793) > + ok 98 - mp_sizeof_decimal(3.141592653589793) =3D=3D = len(mp_encode_decimal(3.141592653589793)) > + ok 99 - mp_next(mp_encode(3.141592653589793)) > + ok 100 - mp_decode(mp_encode(3.141592653589793) len > + ok 101 - mp_decode(mp_encode(3.141592653589793)) value > + ok 102 - mp_decode(mp_encode(3.141592653589793)) scale > + ok 103 - str(mp_decode(mp_encode(3.141592653589793))) =3D=3D = 3.141592653589793 > + ok 104 - stack str =3D=3D static str for 3.141592653589793 > + ok 105 - mp_ext_type is MP_DECIMAL > + ok 106 - decimal_unpack() after mp_decode_extl() > + ok 107 - decimal_unpack() after mp_decode_extl() value > + ok 108 - decimal_unpack() after mp_decode_extl() len > + ok 109 - mp_sizeof_decimal(-3.141592653589793) > + ok 110 - mp_sizeof_decimal(-3.141592653589793) =3D=3D = len(mp_encode_decimal(-3.141592653589793)) > + ok 111 - mp_next(mp_encode(-3.141592653589793)) > + ok 112 - mp_decode(mp_encode(-3.141592653589793) len > + ok 113 - mp_decode(mp_encode(-3.141592653589793)) value > + ok 114 - mp_decode(mp_encode(-3.141592653589793)) scale > + ok 115 - str(mp_decode(mp_encode(-3.141592653589793))) =3D=3D = -3.141592653589793 > + ok 116 - stack str =3D=3D static str for -3.141592653589793 > + ok 117 - mp_ext_type is MP_DECIMAL > + ok 118 - decimal_unpack() after mp_decode_extl() > + ok 119 - decimal_unpack() after mp_decode_extl() value > + ok 120 - decimal_unpack() after mp_decode_extl() len > + ok 121 - = mp_sizeof_decimal(1234567891234567890.0987654321987654321) > + ok 122 - = mp_sizeof_decimal(1234567891234567890.0987654321987654321) =3D=3D = len(mp_encode_decimal(1234567891234567890.0987654321987654321)) > + ok 123 - = mp_next(mp_encode(1234567891234567890.0987654321987654321)) > + ok 124 - = mp_decode(mp_encode(1234567891234567890.0987654321987654321) len > + ok 125 - = mp_decode(mp_encode(1234567891234567890.0987654321987654321)) value > + ok 126 - = mp_decode(mp_encode(1234567891234567890.0987654321987654321)) scale > + ok 127 - = str(mp_decode(mp_encode(1234567891234567890.0987654321987654321))) =3D=3D = 1234567891234567890.0987654321987654321 > + ok 128 - stack str =3D=3D static str for = 1234567891234567890.0987654321987654321 > ok 129 - mp_ext_type is MP_DECIMAL > ok 130 - decimal_unpack() after mp_decode_extl() > ok 131 - decimal_unpack() after mp_decode_extl() value > ok 132 - decimal_unpack() after mp_decode_extl() len > - ok 133 - = mp_sizeof_decimal(0.0000000000000000000000000000000000001) > - ok 134 - = mp_sizeof_decimal(0.0000000000000000000000000000000000001) =3D=3D = len(mp_encode_decimal(0.0000000000000000000000000000000000001)) > - ok 135 - = mp_next(mp_encode(0.0000000000000000000000000000000000001)) > - ok 136 - = mp_decode(mp_encode(0.0000000000000000000000000000000000001) len > - ok 137 - = mp_decode(mp_encode(0.0000000000000000000000000000000000001)) value > - ok 138 - = mp_decode(mp_encode(0.0000000000000000000000000000000000001)) scale > - ok 139 - = str(mp_decode(mp_encode(0.0000000000000000000000000000000000001))) =3D=3D = 0.0000000000000000000000000000000000001 > - ok 140 - mp_ext_type is MP_DECIMAL > - ok 141 - decimal_unpack() after mp_decode_extl() > - ok 142 - decimal_unpack() after mp_decode_extl() value > - ok 143 - decimal_unpack() after mp_decode_extl() len > - ok 144 - = mp_sizeof_decimal(-0.0000000000000000000000000000000000001) > - ok 145 - = mp_sizeof_decimal(-0.0000000000000000000000000000000000001) =3D=3D = len(mp_encode_decimal(-0.0000000000000000000000000000000000001)) > - ok 146 - = mp_next(mp_encode(-0.0000000000000000000000000000000000001)) > - ok 147 - = mp_decode(mp_encode(-0.0000000000000000000000000000000000001) len > - ok 148 - = mp_decode(mp_encode(-0.0000000000000000000000000000000000001)) value > - ok 149 - = mp_decode(mp_encode(-0.0000000000000000000000000000000000001)) scale > - ok 150 - = str(mp_decode(mp_encode(-0.0000000000000000000000000000000000001))) =3D=3D= -0.0000000000000000000000000000000000001 > - ok 151 - mp_ext_type is MP_DECIMAL > - ok 152 - decimal_unpack() after mp_decode_extl() > - ok 153 - decimal_unpack() after mp_decode_extl() value > - ok 154 - decimal_unpack() after mp_decode_extl() len > - ok 155 - = mp_sizeof_decimal(0.00000000000000000000000000000000000001) > - ok 156 - = mp_sizeof_decimal(0.00000000000000000000000000000000000001) =3D=3D = len(mp_encode_decimal(0.00000000000000000000000000000000000001)) > - ok 157 - = mp_next(mp_encode(0.00000000000000000000000000000000000001)) > - ok 158 - = mp_decode(mp_encode(0.00000000000000000000000000000000000001) len > - ok 159 - = mp_decode(mp_encode(0.00000000000000000000000000000000000001)) value > - ok 160 - = mp_decode(mp_encode(0.00000000000000000000000000000000000001)) scale > - ok 161 - = str(mp_decode(mp_encode(0.00000000000000000000000000000000000001))) =3D=3D= 0.00000000000000000000000000000000000001 > - ok 162 - mp_ext_type is MP_DECIMAL > - ok 163 - decimal_unpack() after mp_decode_extl() > - ok 164 - decimal_unpack() after mp_decode_extl() value > - ok 165 - decimal_unpack() after mp_decode_extl() len > - ok 166 - = mp_sizeof_decimal(-0.00000000000000000000000000000000000001) > - ok 167 - = mp_sizeof_decimal(-0.00000000000000000000000000000000000001) =3D=3D = len(mp_encode_decimal(-0.00000000000000000000000000000000000001)) > - ok 168 - = mp_next(mp_encode(-0.00000000000000000000000000000000000001)) > - ok 169 - = mp_decode(mp_encode(-0.00000000000000000000000000000000000001) len > - ok 170 - = mp_decode(mp_encode(-0.00000000000000000000000000000000000001)) value > - ok 171 - = mp_decode(mp_encode(-0.00000000000000000000000000000000000001)) scale > - ok 172 - = str(mp_decode(mp_encode(-0.00000000000000000000000000000000000001))) =3D=3D= -0.00000000000000000000000000000000000001 > - ok 173 - mp_ext_type is MP_DECIMAL > - ok 174 - decimal_unpack() after mp_decode_extl() > - ok 175 - decimal_unpack() after mp_decode_extl() value > - ok 176 - decimal_unpack() after mp_decode_extl() len > - ok 177 - = mp_sizeof_decimal(99999999999999999999999999999999999999) > - ok 178 - = mp_sizeof_decimal(99999999999999999999999999999999999999) =3D=3D = len(mp_encode_decimal(99999999999999999999999999999999999999)) > - ok 179 - = mp_next(mp_encode(99999999999999999999999999999999999999)) > - ok 180 - = mp_decode(mp_encode(99999999999999999999999999999999999999) len > - ok 181 - = mp_decode(mp_encode(99999999999999999999999999999999999999)) value > - ok 182 - = mp_decode(mp_encode(99999999999999999999999999999999999999)) scale > - ok 183 - = str(mp_decode(mp_encode(99999999999999999999999999999999999999))) =3D=3D = 99999999999999999999999999999999999999 > - ok 184 - mp_ext_type is MP_DECIMAL > - ok 185 - decimal_unpack() after mp_decode_extl() > - ok 186 - decimal_unpack() after mp_decode_extl() value > - ok 187 - decimal_unpack() after mp_decode_extl() len > - ok 188 - = mp_sizeof_decimal(-99999999999999999999999999999999999999) > - ok 189 - = mp_sizeof_decimal(-99999999999999999999999999999999999999) =3D=3D = len(mp_encode_decimal(-99999999999999999999999999999999999999)) > - ok 190 - = mp_next(mp_encode(-99999999999999999999999999999999999999)) > - ok 191 - = mp_decode(mp_encode(-99999999999999999999999999999999999999) len > - ok 192 - = mp_decode(mp_encode(-99999999999999999999999999999999999999)) value > - ok 193 - = mp_decode(mp_encode(-99999999999999999999999999999999999999)) scale > - ok 194 - = str(mp_decode(mp_encode(-99999999999999999999999999999999999999))) =3D=3D = -99999999999999999999999999999999999999 > - ok 195 - mp_ext_type is MP_DECIMAL > - ok 196 - decimal_unpack() after mp_decode_extl() > - ok 197 - decimal_unpack() after mp_decode_extl() value > - ok 198 - decimal_unpack() after mp_decode_extl() len > + ok 133 - = mp_sizeof_decimal(-1234567891234567890.0987654321987654321) > + ok 134 - = mp_sizeof_decimal(-1234567891234567890.0987654321987654321) =3D=3D = len(mp_encode_decimal(-1234567891234567890.0987654321987654321)) > + ok 135 - = mp_next(mp_encode(-1234567891234567890.0987654321987654321)) > + ok 136 - = mp_decode(mp_encode(-1234567891234567890.0987654321987654321) len > + ok 137 - = mp_decode(mp_encode(-1234567891234567890.0987654321987654321)) value > + ok 138 - = mp_decode(mp_encode(-1234567891234567890.0987654321987654321)) scale > + ok 139 - = str(mp_decode(mp_encode(-1234567891234567890.0987654321987654321))) =3D=3D= -1234567891234567890.0987654321987654321 > + ok 140 - stack str =3D=3D static str for = -1234567891234567890.0987654321987654321 > + ok 141 - mp_ext_type is MP_DECIMAL > + ok 142 - decimal_unpack() after mp_decode_extl() > + ok 143 - decimal_unpack() after mp_decode_extl() value > + ok 144 - decimal_unpack() after mp_decode_extl() len > + ok 145 - = mp_sizeof_decimal(0.0000000000000000000000000000000000001) > + ok 146 - = mp_sizeof_decimal(0.0000000000000000000000000000000000001) =3D=3D = len(mp_encode_decimal(0.0000000000000000000000000000000000001)) > + ok 147 - = mp_next(mp_encode(0.0000000000000000000000000000000000001)) > + ok 148 - = mp_decode(mp_encode(0.0000000000000000000000000000000000001) len > + ok 149 - = mp_decode(mp_encode(0.0000000000000000000000000000000000001)) value > + ok 150 - = mp_decode(mp_encode(0.0000000000000000000000000000000000001)) scale > + ok 151 - = str(mp_decode(mp_encode(0.0000000000000000000000000000000000001))) =3D=3D = 0.0000000000000000000000000000000000001 > + ok 152 - stack str =3D=3D static str for = 0.0000000000000000000000000000000000001 > + ok 153 - mp_ext_type is MP_DECIMAL > + ok 154 - decimal_unpack() after mp_decode_extl() > + ok 155 - decimal_unpack() after mp_decode_extl() value > + ok 156 - decimal_unpack() after mp_decode_extl() len > + ok 157 - = mp_sizeof_decimal(-0.0000000000000000000000000000000000001) > + ok 158 - = mp_sizeof_decimal(-0.0000000000000000000000000000000000001) =3D=3D = len(mp_encode_decimal(-0.0000000000000000000000000000000000001)) > + ok 159 - = mp_next(mp_encode(-0.0000000000000000000000000000000000001)) > + ok 160 - = mp_decode(mp_encode(-0.0000000000000000000000000000000000001) len > + ok 161 - = mp_decode(mp_encode(-0.0000000000000000000000000000000000001)) value > + ok 162 - = mp_decode(mp_encode(-0.0000000000000000000000000000000000001)) scale > + ok 163 - = str(mp_decode(mp_encode(-0.0000000000000000000000000000000000001))) =3D=3D= -0.0000000000000000000000000000000000001 > + ok 164 - stack str =3D=3D static str for = -0.0000000000000000000000000000000000001 > + ok 165 - mp_ext_type is MP_DECIMAL > + ok 166 - decimal_unpack() after mp_decode_extl() > + ok 167 - decimal_unpack() after mp_decode_extl() value > + ok 168 - decimal_unpack() after mp_decode_extl() len > + ok 169 - = mp_sizeof_decimal(0.00000000000000000000000000000000000001) > + ok 170 - = mp_sizeof_decimal(0.00000000000000000000000000000000000001) =3D=3D = len(mp_encode_decimal(0.00000000000000000000000000000000000001)) > + ok 171 - = mp_next(mp_encode(0.00000000000000000000000000000000000001)) > + ok 172 - = mp_decode(mp_encode(0.00000000000000000000000000000000000001) len > + ok 173 - = mp_decode(mp_encode(0.00000000000000000000000000000000000001)) value > + ok 174 - = mp_decode(mp_encode(0.00000000000000000000000000000000000001)) scale > + ok 175 - = str(mp_decode(mp_encode(0.00000000000000000000000000000000000001))) =3D=3D= 0.00000000000000000000000000000000000001 > + ok 176 - stack str =3D=3D static str for = 0.00000000000000000000000000000000000001 > + ok 177 - mp_ext_type is MP_DECIMAL > + ok 178 - decimal_unpack() after mp_decode_extl() > + ok 179 - decimal_unpack() after mp_decode_extl() value > + ok 180 - decimal_unpack() after mp_decode_extl() len > + ok 181 - = mp_sizeof_decimal(-0.00000000000000000000000000000000000001) > + ok 182 - = mp_sizeof_decimal(-0.00000000000000000000000000000000000001) =3D=3D = len(mp_encode_decimal(-0.00000000000000000000000000000000000001)) > + ok 183 - = mp_next(mp_encode(-0.00000000000000000000000000000000000001)) > + ok 184 - = mp_decode(mp_encode(-0.00000000000000000000000000000000000001) len > + ok 185 - = mp_decode(mp_encode(-0.00000000000000000000000000000000000001)) value > + ok 186 - = mp_decode(mp_encode(-0.00000000000000000000000000000000000001)) scale > + ok 187 - = str(mp_decode(mp_encode(-0.00000000000000000000000000000000000001))) =3D=3D= -0.00000000000000000000000000000000000001 > + ok 188 - stack str =3D=3D static str for = -0.00000000000000000000000000000000000001 > + ok 189 - mp_ext_type is MP_DECIMAL > + ok 190 - decimal_unpack() after mp_decode_extl() > + ok 191 - decimal_unpack() after mp_decode_extl() value > + ok 192 - decimal_unpack() after mp_decode_extl() len > + ok 193 - = mp_sizeof_decimal(99999999999999999999999999999999999999) > + ok 194 - = mp_sizeof_decimal(99999999999999999999999999999999999999) =3D=3D = len(mp_encode_decimal(99999999999999999999999999999999999999)) > + ok 195 - = mp_next(mp_encode(99999999999999999999999999999999999999)) > + ok 196 - = mp_decode(mp_encode(99999999999999999999999999999999999999) len > + ok 197 - = mp_decode(mp_encode(99999999999999999999999999999999999999)) value > + ok 198 - = mp_decode(mp_encode(99999999999999999999999999999999999999)) scale > + ok 199 - = str(mp_decode(mp_encode(99999999999999999999999999999999999999))) =3D=3D = 99999999999999999999999999999999999999 > + ok 200 - stack str =3D=3D static str for = 99999999999999999999999999999999999999 > + ok 201 - mp_ext_type is MP_DECIMAL > + ok 202 - decimal_unpack() after mp_decode_extl() > + ok 203 - decimal_unpack() after mp_decode_extl() value > + ok 204 - decimal_unpack() after mp_decode_extl() len > + ok 205 - = mp_sizeof_decimal(-99999999999999999999999999999999999999) > + ok 206 - = mp_sizeof_decimal(-99999999999999999999999999999999999999) =3D=3D = len(mp_encode_decimal(-99999999999999999999999999999999999999)) > + ok 207 - = mp_next(mp_encode(-99999999999999999999999999999999999999)) > + ok 208 - = mp_decode(mp_encode(-99999999999999999999999999999999999999) len > + ok 209 - = mp_decode(mp_encode(-99999999999999999999999999999999999999)) value > + ok 210 - = mp_decode(mp_encode(-99999999999999999999999999999999999999)) scale > + ok 211 - = str(mp_decode(mp_encode(-99999999999999999999999999999999999999))) =3D=3D = -99999999999999999999999999999999999999 > + ok 212 - stack str =3D=3D static str for = -99999999999999999999999999999999999999 > + ok 213 - mp_ext_type is MP_DECIMAL > + ok 214 - decimal_unpack() after mp_decode_extl() > + ok 215 - decimal_unpack() after mp_decode_extl() value > + ok 216 - decimal_unpack() after mp_decode_extl() len > ok 281 - subtests > 1..5 > *** test_mp_print *** > --=20 > 2.24.3 (Apple Git-128) >=20