diff --git a/MathLib/AnalyticalGeometry.cpp b/MathLib/AnalyticalGeometry.cpp
index 2a9e83c387636cc83ca092573ed5ebb9e81f1d06..8bf66232f5ca56e536dc938ce445f4b1f2f66729 100644
--- a/MathLib/AnalyticalGeometry.cpp
+++ b/MathLib/AnalyticalGeometry.cpp
@@ -10,6 +10,7 @@
  * Created on 2010-03-17 by Thomas Fischer
  */
 
+#include <algorithm>
 #include <cmath>
 #include <cstdlib> // for exit
 #include <list>
@@ -28,7 +29,6 @@
 #include "AnalyticalGeometry.h"
 #include "LinAlg/Solvers/GaussAlgorithm.h"
 #include "LinAlg/Dense/Matrix.h" // for transformation matrix
-#include "max.h"
 
 namespace MathLib {
 
@@ -40,7 +40,7 @@ Orientation getOrientation (const double& p0_x, const double& p0_y,
 	double h2 ((p2_x-p0_x)*(p1_y-p0_y));
 
 	double tol (sqrt(std::numeric_limits<double>::min()));
-	if (fabs (h1-h2) <= tol * max (fabs(h1), fabs(h2)))
+	if (fabs (h1-h2) <= tol * std::max (fabs(h1), fabs(h2)))
 		return COLLINEAR;
 	if (h1-h2 > 0.0) return CCW;
 
diff --git a/MathLib/max.h b/MathLib/max.h
deleted file mode 100644
index 055f705fbf141575a53ac43c381d514135d5178c..0000000000000000000000000000000000000000
--- a/MathLib/max.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.org)
- *            Distributed under a Modified BSD License.
- *              See accompanying file LICENSE.txt or
- *              http://www.opengeosys.org/project/license
- *
- *
- * \file max.h
- *
- * Created on 2010-04-20 by Thomas Fischer
- */
-
-#ifndef MAX_H_
-#define MAX_H_
-
-/**
- * max returns the maximum of its arguments
- */
-template<class T> T max(const T& arg0, const T& arg1)
-{
-  if (arg0 < arg1) return arg1;
-  return arg0;
-}
-
-#endif /* MAX_H_ */