[gnome-calculator] Fix modulo with negative divisor bug
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Fix modulo with negative divisor bug
- Date: Tue, 18 Dec 2012 23:04:29 +0000 (UTC)
commit ec911f20f84ec480507ed28adb87d47297abf3c0
Author: PioneerAxon <arth svnit gmail com>
Date: Sat Dec 8 03:49:47 2012 +0530
Fix modulo with negative divisor bug
src/number.vala | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/number.vala b/src/number.vala
index b8ad8aa..2ca0f62 100644
--- a/src/number.vala
+++ b/src/number.vala
@@ -1165,9 +1165,9 @@ public class Number
var z = subtract (t2);
t1 = new Number.integer (0);
- if ((y.compare (t1) < 0 && z.compare (t1) > 0) || z.compare (t1) < 0)
+ if ((y.compare (t1) < 0 && z.compare (t1) > 0) || (y.compare (t1) > 0 && z.compare (t1) < 0))
z = z.add (y);
-
+
return z;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]