[gcalctool] Fix acos/asin/atan not working (found by Cathy Garrett)



commit b8f99cd73c07d5577b36dc1563c7caa0a7edd4e2
Author: Robert Ancell <robert ancell canonical com>
Date:   Sat Mar 17 12:57:36 2012 +1100

    Fix acos/asin/atan not working (found by Cathy Garrett)

 NEWS                   |    4 ++++
 src/mp-equation.c      |    1 +
 src/test-mp-equation.c |    4 ++++
 3 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 3057b64..a8845c1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Overview of changes in gcalctool 6.4.0
+
+    * Fix acos/asin/atan not working
+
 Overview of changes in gcalctool 6.3.92
 
     * Remove widget background color tints (not working in recent GTK themes)
diff --git a/src/mp-equation.c b/src/mp-equation.c
index dc1eff7..addff8e 100644
--- a/src/mp-equation.c
+++ b/src/mp-equation.c
@@ -132,6 +132,7 @@ function_is_defined(MPEquationParserState *state, const char *name)
         strcmp(lower_name, "re") == 0 ||
         strcmp(lower_name, "im") == 0 ||
         strcmp(lower_name, "sin") == 0 || strcmp(lower_name, "cos") == 0 || strcmp(lower_name, "tan") == 0 ||
+        strcmp(lower_name, "asin") == 0 || strcmp(lower_name, "acos") == 0 || strcmp(lower_name, "atan") == 0 ||
         strcmp(lower_name, "sinâÂ") == 0 || strcmp(lower_name, "cosâÂ") == 0 || strcmp(lower_name, "tanâÂ") == 0 ||
         strcmp(lower_name, "sinh") == 0 || strcmp(lower_name, "cosh") == 0 || strcmp(lower_name, "tanh") == 0 ||
         strcmp(lower_name, "sinhâÂ") == 0 || strcmp(lower_name, "coshâÂ") == 0 || strcmp(lower_name, "tanhâÂ") == 0 ||
diff --git a/src/test-mp-equation.c b/src/test-mp-equation.c
index 46fdbf3..3a60acb 100644
--- a/src/test-mp-equation.c
+++ b/src/test-mp-equation.c
@@ -509,11 +509,15 @@ test_equations()
     test("cosâ 1", "0", 0);
     test("cosâ (â1)", "180", 0);
     test("cosâ (1Ãâ2)", "45", 0);
+    test("acos 0", "90", 0);
+    test("acos 1", "0", 0);
 
     test("sinâ 0", "0", 0);
     test("sinâ 1", "90", 0);
     test("sinâ (â1)", "â90", 0);
     test("sinâ (1Ãâ2)", "45", 0);
+    test("asin 0", "0", 0);
+    test("asin 1", "90", 0);
 
     test("cosh 0", "1", 0);
     test("cosh 10 â (e^10 + e^â10)Ã2", "0", 0);



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