change mod to use unsigned ints
authorPatrik Gornicz <Gornicz.P@gmail.com>
Wed, 19 Aug 2009 03:44:34 +0000 (23:44 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Wed, 19 Aug 2009 03:44:34 +0000 (23:44 -0400)
lib/include/bear/mathw.h
lib/src/mathw.cpp

index 07f5769..de9538f 100644 (file)
@@ -30,7 +30,7 @@ namespace bear
 
     /// ***** Header Methods *****
 
-    int mod(int, int);
+    unsigned int mod(unsigned int, unsigned int);
 
     /// Vector2 Math
 
index 35d866b..db4fafb 100644 (file)
@@ -27,11 +27,12 @@ using namespace bear;
 
 /// ***** Public Methods *****
 
-int bear::mod(int x, int y)
+unsigned int bear::mod(unsigned int x, unsigned int y)
 {
-  return x % y + (x < 0 ? y : 0);
+  return x % y;
 }
 
+
 // Vector2 Math
 
 Vector2 bear::vectorToLine