qt6-bb10/tests/auto/corelib
Edward Welbourne 9bad096c09 Use a more forgiving threshold for qFuzzyIsNull(qfloat16)
Analysis of problems with the new test for qFuzzyIsNull() revealed
that, where its version for double uses approximately 4500 * epsilon
and for float used 84 * epsilon as threshold, the qfloat16 version's
value was barely more than epsilon, with the result that the test had
to use a different value than the threshold to pass. (Converting the
threshold from float to qfloat16 and back made it bigger; in effect,
the threshold value was not <= itself.)

Furthermore, comparison with qFuzzyCompare() implied a value of
1/102.5 should be used, roughly 10 * epsilon, for consistency.  When
1/102.5 is rounded to three significant digits (the precision we use
in QTest::toString(), for example), to give 0.00976f as threshold, we
get a value that, after conversion to qfloat16 and back to float, does
give a result <= what we started with. So change qFuzzyIsNull() and
its test to use this as qfloat16's threshold value.

[ChangeLog][QtCore][QFloat16] The qfloat16 threshold value for
qFuzzyIsNull() has changed from 1e-3 to 9.76e-3, almost a factor of
ten increase, for consistency with qFuzzyCompare()'s tolerance. Values
between these would previously have had qFuzzyIsNull(f) false despite
qFuzzyCompre(f, 1+f) being true.

Change-Id: I35816dce78da34a3e2339c8bc42d5bd03714a3f6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-29 14:13:23 +02:00
..
animation Port QPropertyAnimation::targetObject to bindable properties 2021-04-28 12:38:57 +02:00
global Use a more forgiving threshold for qFuzzyIsNull(qfloat16) 2021-04-29 14:13:23 +02:00
io Fix warnings from deprecated posix functions 2021-04-28 06:48:33 +02:00
itemmodels Port of QItemSelectionModel::model to new property system 2021-04-27 20:12:50 +02:00
kernel Fix namespace error of std::source_location under C++20 2021-04-29 09:12:47 +00:00
mimetypes Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
plugin Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
serialization Fix compiler warning from int size mismatch 2021-04-29 06:32:17 +02:00
text Add more tests for QList/QString/QBA 2021-04-27 14:12:34 +02:00
thread QThreadPool: obey the docs that say we always use at least 1 thread 2021-04-24 00:37:14 +00:00
time Revert early return from QTimeZone on invalid ID 2021-04-29 14:13:23 +02:00
tools Fix comparison between nullptr and QWeakPointer 2021-04-28 23:33:06 +03:00
CMakeLists.txt Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00