Permalink
Browse files

Added a sign() function to vgl_utils.

  • Loading branch information...
1 parent 8ce9ed5 commit cc864a170204fed58745d6ad693caed705d5ce53 @vilya committed Aug 31, 2010
Showing with 7 additions and 0 deletions.
  1. +6 −0 src/vgl_utils.cpp
  2. +1 −0 src/vgl_utils.h
View
@@ -10,6 +10,12 @@ namespace vgl {
// HELPER FUNCTIONS
//
+int sign(int i)
+{
+ return (i < 0) ? -1 : 1;
+}
+
+
bool equal(float a, float b, float epsilon)
{
return std::abs(a - b) < epsilon;
View
@@ -56,6 +56,7 @@ enum StringAlignment {
// HELPER FUNCTIONS
//
+int sign(int i);
bool equal(float a, float b, float epsilon=1e-5f);
bool equal(double a, double b, double epsilon=1e-10);

0 comments on commit cc864a1

Please sign in to comment.