[Ecls-list] BUG: unexpected FLOATING-POINT-UNDERFLOW on Linux/armhf

Eric Marsden eric.marsden at free.fr
Sat Mar 30 23:59:57 UTC 2013

>>>>> "jg" == Juan Jose Garcia-Ripoll <juanjose.garciaripoll at gmail.com> writes:

  jg> ECL uses tanf() for computing the tangent with single-floats. If you have a
  jg> look at the code in ecl/src/c/numbers/tan.d you will find the lines below.
  jg> One possibility would be to uncomment safe_tanf() and see whether ECL now
  jg> works. If this is the case then we might have to add another switch for
  jg> your platform :-/

  Thanks for the suggestion. With the patch below, tan seems to work

diff --git a/src/c/numbers/tan.d b/src/c/numbers/tan.d
index 511e1e3..5700590 100644
--- a/src/c/numbers/tan.d
+++ b/src/c/numbers/tan.d
@@ -28,7 +28,7 @@
  * solved. Not only that, but if we use tan() on float, GCC automatically
  * and stupidly forces the use of tanf().
-#if defined(__amd64__) && defined(__GLIBC__)
+#if (defined(__amd64__) || defined(__arm__)) && defined(__GLIBC__)
 static double safe_tanf(double x) { return tan(x); }
 # define safe_tanf(x) tanf(x)

Eric Marsden

More information about the ecl-devel mailing list