Ignore:
Timestamp:
2015-05-17T15:52:24+02:00 (9 years ago)
Author:
Don-vip
Message:

squid:S1244 - Floating point numbers should not be tested for equality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java

    r8345 r8384  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.coor;
     3
     4import org.openstreetmap.josm.tools.Utils;
    35
    46public final class QuadTiling {
     
    6870    static long lon2x(double lon) {
    6971        long ret = (long)((lon + 180.0) * WORLD_PARTS / 360.0);
    70         if (ret == WORLD_PARTS) {
     72        if (Utils.equalsEpsilon(ret, WORLD_PARTS)) {
    7173            ret--;
    7274        }
     
    7678    static long lat2y(double lat) {
    7779        long ret = (long)((lat + 90.0) * WORLD_PARTS / 180.0);
    78         if (ret == WORLD_PARTS) {
     80        if (Utils.equalsEpsilon(ret, WORLD_PARTS)) {
    7981            ret--;
    8082        }
Note: See TracChangeset for help on using the changeset viewer.