[gnumeric] gnm_float: use proper functions, not plain libc.



commit 64eb3288943576eeedee81dd9825dfe5eeb17886
Author: Morten Welinder <terra gnome org>
Date:   Sun Mar 6 17:51:59 2016 -0500

    gnm_float: use proper functions, not plain libc.
    
    gnm_cosh, not simply cosh.

 plugins/fn-complex/gsl-complex.c |    6 +++---
 plugins/fn-tsa/functions.c       |    2 +-
 src/sf-bessel.c                  |    4 ++--
 src/sf-gamma.c                   |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/plugins/fn-complex/gsl-complex.c b/plugins/fn-complex/gsl-complex.c
index 000ce61..6a8dbf4 100644
--- a/plugins/fn-complex/gsl-complex.c
+++ b/plugins/fn-complex/gsl-complex.c
@@ -305,7 +305,7 @@ gsl_complex_sinh (gnm_complex const *a, gnm_complex *res)
 {                               /* z = sinh(a) */
         gnm_float R = GSL_REAL (a), I = GSL_IMAG (a);
 
-       *res = GNM_CMAKE (gnm_sinh (R) * gnm_cos (I), cosh (R) * gnm_sin (I));
+       *res = GNM_CMAKE (gnm_sinh (R) * gnm_cos (I), gnm_cosh (R) * gnm_sin (I));
 }
 
 void
@@ -313,7 +313,7 @@ gsl_complex_cosh (gnm_complex const *a, gnm_complex *res)
 {                               /* z = cosh(a) */
         gnm_float R = GSL_REAL (a), I = GSL_IMAG (a);
 
-       *res = GNM_CMAKE (cosh (R) * gnm_cos (I), gnm_sinh (R) * gnm_sin (I));
+       *res = GNM_CMAKE (gnm_cosh (R) * gnm_cos (I), gnm_sinh (R) * gnm_sin (I));
 }
 
 void
@@ -326,7 +326,7 @@ gsl_complex_tanh (gnm_complex const *a, gnm_complex *res)
                         gnm_pow (gnm_cos (I), 2.0) +
                         gnm_pow (gnm_sinh (R), 2.0);
 
-                *res = GNM_CMAKE (gnm_sinh (R) * cosh (R) / D,
+                *res = GNM_CMAKE (gnm_sinh (R) * gnm_cosh (R) / D,
                               0.5 * gnm_sin (2 * I) / D);
        } else {
                 gnm_float D =
diff --git a/plugins/fn-tsa/functions.c b/plugins/fn-tsa/functions.c
index 8984413..6bef952 100644
--- a/plugins/fn-tsa/functions.c
+++ b/plugins/fn-tsa/functions.c
@@ -782,7 +782,7 @@ no_absc:
                case FILTER_HANN:
                        factor = 2. * M_PIgnum / n0;
                        for (i = 0; i < n0; i++)
-                               ord[i] *= 0.5 * (1 - cos (factor * i));
+                               ord[i] *= 0.5 * (1 - gnm_cos (factor * i));
                        break;
                case FILTER_WELCH:
                        factor = n0 / 2.;
diff --git a/src/sf-bessel.c b/src/sf-bessel.c
index 02216fa..5a6afce 100644
--- a/src/sf-bessel.c
+++ b/src/sf-bessel.c
@@ -2103,7 +2103,7 @@ integral_127_u (gnm_float v)
        gnm_float vv, u = 0;
 
        if (v >= 1)
-               return acosh (v / gnm_sin (v));
+               return gnm_acosh (v / gnm_sin (v));
 
        // Above formula will suffer from cancellation
        vv = v * v;
@@ -2112,7 +2112,7 @@ integral_127_u (gnm_float v)
        u *= v;
 
        if (0) {
-               gnm_float ref = acosh (v / gnm_sin (v));
+               gnm_float ref = gnm_acosh (v / gnm_sin (v));
                g_printerr ("XXX: %g %g\n", ref, u);
        }
 
diff --git a/src/sf-gamma.c b/src/sf-gamma.c
index b5d5ecb..57e921a 100644
--- a/src/sf-gamma.c
+++ b/src/sf-gamma.c
@@ -1393,7 +1393,7 @@ gnm_complex_continued_fraction (gnm_complex *dst, size_t N,
                        if (m == 0)
                                return FALSE;
 
-                       (void)frexp (m, &e);
+                       (void)gnm_frexp (m, &e);
                        if (debug_cf)
                                g_printerr ("rescale by 2^%d\n", -e);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]