[gcalctool/gnome-2-32] Fix incorrect calculation of tanh



commit 3b32345ad320f3f1d946d2c821680e8a9715da31
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Nov 22 21:11:56 2010 +1100

    Fix incorrect calculation of tanh

 NEWS                   |    4 ++++
 src/mp-trigonometric.c |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 8dfe0c4..0562511 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Overview of changes in gcalctool 5.32.2
+
+    * Fix incorrect calculation of tanh
+
 Overview of changes in gcalctool 5.32.1
 
     * Fix crash when pasting with empty clipboard (Bug #629381)
diff --git a/src/mp-trigonometric.c b/src/mp-trigonometric.c
index 2ebc676..0676e42 100644
--- a/src/mp-trigonometric.c
+++ b/src/mp-trigonometric.c
@@ -557,6 +557,7 @@ mp_tanh(const MPNumber *x, MPNumber *z)
     } else {
         mp_epowy(&t, &t);
         mp_add_integer(&t, 1, z);
+        mp_add_integer(&t, -1, &t);
         mp_divide(&t, z, z);
     }
 



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