[gnome-calculator] 0^0 is indeterminate



commit f98fc53d29e8050bfdad94eaff65a67ebb24ab6f
Author: Elita Lobo <loboelita gmail com>
Date:   Wed Feb 19 10:46:50 2014 +0530

    0^0 is indeterminate
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724114

 src/number.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/number.vala b/src/number.vala
index 81d2811..832a53a 100644
--- a/src/number.vala
+++ b/src/number.vala
@@ -910,6 +910,14 @@ public class Number
             return new Number.integer (0);
         }
 
+        /* 0^0 is indeterminate */
+        if (is_zero () && n == 0)
+        {
+            /* Translators: Error displayed when attempted to raise 0 to power of zero */
+            mperr (_("Zero raised to zero is undefined"));
+            return new Number.integer (0);
+        }
+
         /* x^0 = 1 */
         if (n == 0)
             return new Number.integer (1);


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