diff --git a/LCS/PyCommon/math.py b/LCS/PyCommon/math.py
index b461a4202bbd588b5184647ce0cb7210317444ec..3dd0b351b9ab6a84ed89cf3581be91aa4b0740e2 100644
--- a/LCS/PyCommon/math.py
+++ b/LCS/PyCommon/math.py
@@ -1,7 +1,10 @@
-from fractions import gcd
+try:
+    from math import gcd
+except ImportError:
+    from fractions import gcd
 
 __all__ = ["lcm"]
 
 def lcm(a, b):
     """ Return the Least Common Multiple of a and b. """
-    return abs(a * b) / gcd(a, b) if a and b else 0
+    return int(abs(a * b) / gcd(a, b) if a and b else 0)