This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Subject: [PATCH] Reduce four PyLong digits per division in the one-digit remainder | |
| When only the remainder is needed, reduce blocks of four dividend digits | |
| using the first four powers of PyLong_BASE modulo the divisor. The sum | |
| fits in twodigits for both supported digit widths. Use the existing | |
| digit-at-a-time loop for short dividends and the final partial block. | |
| Base-commit: 22691a32b122cff3ad17460c068f70e806cd7e84 | |
| diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/mpf/div_ui.c | |
| +++ b/mpf/div_ui.c | |
| @@ -36,14 +36,13 @@ | |
| mpf_div_ui (mpf_ptr r, mpf_srcptr u, unsigned long int v) | |
| { | |
| mp_srcptr up; | |
| - mp_ptr rp, tp, rtp; | |
| + mp_ptr rp; | |
| mp_size_t usize; | |
| - mp_size_t rsize, tsize; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/ext/bigdecimal/bigdecimal.c | |
| +++ b/ext/bigdecimal/bigdecimal.c | |
| @@ -4951,6 +4951,7 @@ | |
| size_t nLoop; | |
| DECDIG_DBL q, b1, b1p1, b1b2, b1b2p1, r1r2; | |
| DECDIG borrow1, borrow2; | |
| + DECDIG start = 0; | |
| DECDIG_DBL qb; | |
| VpSetNaN(r); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 6c2fd2b3373a68a79aabf3a5c49f1d68ff68a877 Mon Sep 17 00:00:00 2001 | |
| From: Mike Purvis <mikedotexe@gmail.com> | |
| Date: Wed, 25 Nov 2026 15:41:50 -0800 | |
| Subject: [PATCH] math/big: format Rat decimals in blocks for one-word | |
| denominators | |
| FloatString scales the remainder by 10^prec before dividing to get the | |
| fractional digits. When the denominator fits in a Word, the remainder | |
| does too. Use long division to write several decimal digits at a time | |
| without constructing that power of ten. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/mpf/div_ui.c | |
| +++ b/mpf/div_ui.c | |
| @@ -36,9 +36,9 @@ | |
| mpf_div_ui (mpf_ptr r, mpf_srcptr u, unsigned long int v) | |
| { | |
| mp_srcptr up; | |
| - mp_ptr rp, tp, rtp; | |
| + mp_ptr rp; | |
| mp_size_t usize; | |
| - mp_size_t rsize, tsize; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/extension/core_functions/aggregate/distributive/sum.cpp | |
| +++ b/extension/core_functions/aggregate/distributive/sum.cpp | |
| @@ -7,6 +7,7 @@ | |
| #include "duckdb/common/types/decimal_helper.hpp" | |
| #include "duckdb/common/types/hugeint.hpp" | |
| #include "duckdb/common/types/decimal.hpp" | |
| +#include "duckdb/common/vector/sequence_vector.hpp" | |
| #include "duckdb/function/aggregate/distributive_function_utils.hpp" | |
| #include "duckdb/planner/expression/bound_aggregate_expression.hpp" | |
| #include "duckdb/common/serializer/deserializer.hpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/mpf/div_ui.c | |
| +++ b/mpf/div_ui.c | |
| @@ -82,6 +82,30 @@ | |
| up = u->_mp_d; | |
| tsize = 1 + prec; | |
| + | |
| +#if GMP_NAIL_BITS == 0 | |
| + if (tsize - usize >= 24) | |
| + { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/libmpdec/mpdecimal.c | |
| +++ b/libmpdec/mpdecimal.c | |
| @@ -3749,6 +3749,103 @@ | |
| *status |= MPD_Clamped; | |
| } | |
| +/* Divide rem*MPD_RADIX by v, writing one quotient word. */ | |
| +static inline mpd_uint_t | |
| +_mpd_shortdiv_zero(mpd_uint_t *q, mpd_uint_t rem, mpd_uint_t v) | |
| +{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/libmpdec/mpdecimal.c | |
| +++ b/libmpdec/mpdecimal.c | |
| @@ -3749,6 +3749,55 @@ | |
| *status |= MPD_Clamped; | |
| } | |
| +/* Divide rem*MPD_RADIX by v, writing one quotient word. */ | |
| +static inline mpd_uint_t | |
| +_mpd_shortdiv_zero(mpd_uint_t *q, mpd_uint_t rem, mpd_uint_t v) | |
| +{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Convert a one-Hz UTC clock sequence to two-part Julian dates. | |
| The synthetic inputs cover every UTC second of the final minute on 2016-12-30 | |
| (60 labels) or 2016-12-31 (61, including 23:59:60). SOFA's post-1972 UTC | |
| quasi-JD convention maps an entire civil day to one unit, so its fractional | |
| part uses the actual day length. This fixture deliberately covers those two | |
| historical dates only. Julian dates begin at noon, so midnight ends in .5. | |
| https://static1.squarespace.com/static/68caa251ae552a6213e8764b/t/68d3e216e1cf0121bd4273a6/1758716438331/sofa_ts_c.pdf | |
| https://www.nist.gov/pml/time-and-frequency-division/time-realization/leap-seconds |
NewerOlder