[libmatheval] 02/03: Imported Debian patch 1.1.11+dfsg-1.2
Julian Taylor
jtaylor.debian at googlemail.com
Sun Oct 26 02:19:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
jtaylor-guest pushed a commit to branch master
in repository libmatheval.
commit ed9b4c74bd1d54605f78369a3cd1669e73f6610f
Author: Neil Williams <codehelp at debian.org>
Date: Tue Oct 7 15:04:50 2014 +0100
Imported Debian patch 1.1.11+dfsg-1.2
---
debian/changelog | 12 +++++
debian/libmatheval1.symbols | 1 +
debian/patches/004-arch-optimisation.patch | 73 ++++++++++++++++++++++++++++++
debian/patches/series | 1 +
4 files changed, 87 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 94caa6b..b6c68d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+libmatheval (1.1.11+dfsg-1.2) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Add a fix to lib/xmath.c to limit the precision to
+ within the range compatible with the current compiler
+ optimisations so that the uncertain process of comparing
+ floating point numbers can be used in the test suite.
+ Completes the migration to guile-2.0 (Closes: #746013)
+ * Update symbols for the patched function
+
+ -- Neil Williams <codehelp at debian.org> Tue, 07 Oct 2014 15:04:50 +0100
+
libmatheval (1.1.11+dfsg-1.1) unstable; urgency=low
* Non-maintainer upload.
diff --git a/debian/libmatheval1.symbols b/debian/libmatheval1.symbols
index b50aba3..8090a80 100644
--- a/debian/libmatheval1.symbols
+++ b/debian/libmatheval1.symbols
@@ -48,6 +48,7 @@ libmatheval.so.1 libmatheval1 #MINVER#
math_sec at Base 1.1.3
math_sech at Base 1.1.3
math_step at Base 1.1.3
+ math_truncate15 at Base 1.1.11
node_copy at Base 1.1.3
node_create at Base 1.1.3
node_derivative at Base 1.1.3
diff --git a/debian/patches/004-arch-optimisation.patch b/debian/patches/004-arch-optimisation.patch
new file mode 100644
index 0000000..dac62ad
--- /dev/null
+++ b/debian/patches/004-arch-optimisation.patch
@@ -0,0 +1,73 @@
+Description: Compiler optimisation affects on floating point tests.
+ Truncate the precision of a returned double to 15 places.
+ This allows for compiler optimisations which may change the
+ comparison of floating point numbers on particular architectures.
+ .
+ libmatheval (1.1.11+dfsg-1.2) unstable; urgency=low
+ .
+ * Non-maintainer upload.
+ * Add a fix to lib/xmath.c to limit the precision to
+ within the range compatible with the current compiler
+ optimisations so that the uncertain process of comparing
+ floating point numbers can be used in the test suite.
+ Completes the migration to guile-2.0 (Closes: #746013)
+Author: Dave Pigott <dave.pigott at linaro.org>
+Bug-Debian: https://bugs.debian.org/746013
+
+---
+
+--- libmatheval-1.1.11+dfsg.orig/lib/xmath.c
++++ libmatheval-1.1.11+dfsg/lib/xmath.c
+@@ -19,8 +19,32 @@
+ * <http://www.gnu.org/licenses/>.
+ */
+
++#include <stdio.h>
+ #include "xmath.h"
+
++
++double
++math_truncate15(double x)
++{
++ /*
++ * Truncate the precision of a returned double to 15 decimal places
++ * This is hacky, and as at the time of writing, is only required for
++ * the "coth" function, which due to optimisation and floating point
++ * width, gives a different result on i386 to all other platforms
++ * At the moment we're dealing with an explicit 15 significant digits.
++ * This could be generalised to a "give me n digits of precision" type
++ * solution
++ */
++ double d;
++ char s[128];
++
++ sprintf(s, "%.15f", x);
++ sscanf(s, "%lf", &d);
++
++ return d;
++}
++
++
+ double
+ math_cot(double x)
+ {
+@@ -81,7 +105,7 @@ math_coth(double x)
+ /*
+ * Calculate hyperbolic cotangent value.
+ */
+- return 1 / tanh(x);
++ return math_truncate15(1 / tanh(x));
+ }
+
+ double
+--- libmatheval-1.1.11+dfsg.orig/tests/functions.at
++++ libmatheval-1.1.11+dfsg/tests/functions.at
+@@ -335,7 +335,7 @@ AT_DATA([function.scm],
+ (display (evaluator-evaluate-x f 1))
+ ]])
+
+-AT_CHECK([matheval.sh function.scm], [ignore], [1.3130352854993315], [ignore])
++AT_CHECK([matheval.sh function.scm], [ignore], [1.313035285499331], [ignore])
+
+ AT_DATA([function.scm],
+ [[
diff --git a/debian/patches/series b/debian/patches/series
index 742dd9b..9e40121 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
002-skip-docs.patch
003-guile2.0.patch
+004-arch-optimisation.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libmatheval.git
More information about the debian-science-commits
mailing list