Skip to content

Commit 66bcff3

Browse files
committed
Make tl_signature match argument order of the fma() in C
1 parent 16ea0db commit 66bcff3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/mathmodule.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2868,7 +2868,7 @@ typedef struct { double hi; double lo; double tiny; } TripleLength;
28682868
static const TripleLength tl_zero = {0.0, 0.0, 0.0};
28692869

28702870
static TripleLength
2871-
tl_fma(TripleLength total, double x, double y)
2871+
tl_fma(double x, double y, TripleLength total)
28722872
{
28732873
// Algorithm 5.10 with SumKVert for K=3
28742874
DoubleLength pr = dl_mul(x, y);
@@ -3048,7 +3048,7 @@ math_sumprod_impl(PyObject *module, PyObject *p, PyObject *q)
30483048
} else {
30493049
goto finalize_flt_path;
30503050
}
3051-
TripleLength new_flt_total = tl_fma(flt_total, flt_p, flt_q);
3051+
TripleLength new_flt_total = tl_fma(flt_p, flt_q, flt_total);
30523052
if (isfinite(new_flt_total.hi)) {
30533053
flt_total = new_flt_total;
30543054
flt_total_in_use = true;

0 commit comments

Comments
 (0)