Commit ef81d2ea authored by Alexander Barkov's avatar Alexander Barkov

Fixing "mtr func_math" failure in the test for MDEV-17643

Adding an intermediate volatile variable to avoid using co-processor registers
on some platforms (e.g. 32-bit x86).
This change makes test results stable accross all platforms.
parent 3b98c65c
......@@ -1824,8 +1824,9 @@ static void variance_fp_recurrence_next(double *m, double *s, ulonglong *count,
else
{
double m_kminusone= *m;
*m= m_kminusone + (nr - m_kminusone) / (double) *count;
*s= *s + (nr - m_kminusone) * (nr - *m);
volatile double diff= nr - m_kminusone;
*m= m_kminusone + diff / (double) *count;
*s= *s + diff * (nr - *m);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment