Index: /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 5267)
+++ /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 5268)
@@ -11,6 +11,4 @@
 import static org.openstreetmap.josm.tools.I18n.trc;
 
-import java.math.BigDecimal;
-import java.math.MathContext;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
@@ -35,4 +33,5 @@
      */
     public static final double MAX_SERVER_PRECISION = 1e-7;
+    public static final double MAX_SERVER_INV_PRECISION = 1e7;
     public static final int    MAX_SERVER_DIGITS = 7;
 
@@ -265,18 +264,15 @@
      */
     public static double roundToOsmPrecision(double value) {
-        return Math.round(value / MAX_SERVER_PRECISION) * MAX_SERVER_PRECISION; // causes tiny rounding errors (see LatLonTest)
-    }
-
-    /**
-     * Returns the value rounded to OSM precisions, i.e. to
-     * LatLon.MAX_SERVER_PRECISION. The result is guaranteed to be exact, but at a great cost.
-     * This function is about 1000 times slower than roundToOsmPrecision(), use it with caution.
+        return Math.round(value * MAX_SERVER_INV_PRECISION) / MAX_SERVER_INV_PRECISION;
+    }
+
+    /**
+     * Returns the value rounded to OSM precision. This function is now the same as
+     * {@link #roundToOsmPrecision(double)}, since the rounding error has been fixed.
      *
      * @return rounded value
      */
     public static double roundToOsmPrecisionStrict(double value) {
-        double absV = Math.abs(value);
-        int numOfDigits = MAX_SERVER_DIGITS + (absV < 1 ? 0 : (absV < 10 ? 1 : (absV < 100 ? 2 : 3)));
-        return BigDecimal.valueOf(value).round(new MathContext(numOfDigits)).doubleValue();
+        return roundToOsmPrecision(value);
     }
 
