Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hugin_math.cpp
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
23 #include "hugin_math.h"
24 #include "hugin_utils/utils.h"
25 
27 namespace hugin_utils
28 {
29  int _gcd(int a, int b)
30  {
31  // calculate greated common divisor using Euclidean algorithm
32  return b == 0 ? a : _gcd(b, a % b);
33  }
34 
35  int gcd(int a, int b)
36  {
37  // enforce that both arguments are positive
38  return _gcd(abs(a), abs(b));
39  }
40 
41 } // namespace
int _gcd(int a, int b)
Definition: hugin_math.cpp:29
int gcd(int a, int b)
function to calculate greated common divisor using Euclidean algorithm both arguments should be >=0 ...
Definition: hugin_math.cpp:35
misc math function & classes used by other parts of the program