[med-svn] [Git][med-team/igraph][master] Fix test suite on i386 (see upstream issue #1894)
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sun Dec 19 06:59:18 GMT 2021
Andreas Tille pushed to branch master at Debian Med / igraph
Commits:
684579ef by Andreas Tille at 2021-12-19T07:59:03+01:00
Fix test suite on i386 (see upstream issue #1894)
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/8c5711d8d143a40602dbd177f1a343471304efa7.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -2,6 +2,7 @@ igraph (0.9.5+ds-2) UNRELEASED; urgency=medium
* Fix watchfile (comment) to detect new versions on github
* cme fix dpkg-control
+ * Fix test suite on i386 (see upstream issue #1894)
-- Andreas Tille <tille at debian.org> Fri, 17 Dec 2021 06:48:35 +0100
=====================================
debian/patches/8c5711d8d143a40602dbd177f1a343471304efa7.patch
=====================================
@@ -0,0 +1,44 @@
+From 8c5711d8d143a40602dbd177f1a343471304efa7 Mon Sep 17 00:00:00 2001
+From: Tamas Nepusz <ntamas at gmail.com>
+Date: Fri, 17 Dec 2021 21:35:27 +0100
+Subject: [PATCH] fix: more rigorous version of igraph_cmp_epsilon(), really
+ fixes #1894
+Origin: https://github.com/igraph/igraph/commit/8c5711d8d143a40602dbd177f1a343471304efa7
+ https://github.com/igraph/igraph/commit/1031f3d35ca064301d6af10900f80d15f5d2d50b
+
+---
+ src/math/utils.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+--- a/src/math/utils.c
++++ b/src/math/utils.c
+@@ -294,6 +294,7 @@ int igraph_almost_equals(double a, doubl
+ int igraph_cmp_epsilon(double a, double b, double eps) {
+ double diff;
+ double abs_diff;
++ double sum;
+
+ if (a == b) {
+ /* shortcut, handles infinities */
+@@ -302,14 +303,18 @@ int igraph_cmp_epsilon(double a, double
+
+ diff = a - b;
+ abs_diff = fabs(diff);
++ sum = fabs(a) + fabs(b);
+
+- if (a == 0 || b == 0 || diff < DBL_MIN) {
++ if (a == 0 || b == 0 || abs_diff < DBL_MIN) {
+ /* a or b is zero or both are extremely close to it; relative
+ * error is less meaningful here so just compare it with
+ * epsilon */
+ return abs_diff < (eps * DBL_MIN) ? 0 : (diff < 0 ? -1 : 1);
++ } else if (!isfinite(sum)) {
++ /* addition overflow, so presumably |a| and |b| are both large; use a
++ * different formulation */
++ return (abs_diff < (eps * fabs(a) + eps * fabs(b))) ? 0 : (diff < 0 ? -1 : 1);
+ } else {
+- /* use relative error */
+- return (abs_diff / (fabs(a) + fabs(b)) < eps) ? 0 : (diff < 0 ? -1 : 1);
++ return (abs_diff / sum < eps) ? 0 : (diff < 0 ? -1 : 1);
+ }
+ }
=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@ upstream-external-plfit.patch
debianization.patch
debianization-suitesparse-header_folder.patch
debianization-doc-local_fonts.patch
+8c5711d8d143a40602dbd177f1a343471304efa7.patch
View it on GitLab: https://salsa.debian.org/med-team/igraph/-/commit/684579ef805104a9a24eed050a3050afe2977019
--
View it on GitLab: https://salsa.debian.org/med-team/igraph/-/commit/684579ef805104a9a24eed050a3050afe2977019
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20211219/303ec300/attachment-0001.htm>
More information about the debian-med-commit
mailing list