floating point comparison

This commit is contained in:
glax 2023-05-17 19:13:31 +02:00
parent 9f0d47ed59
commit 2b5dd91335

View File

@ -21,8 +21,7 @@ public class Coordinates
if (obj == null || obj.GetType() != this.GetType())
return false;
Coordinates convObj = (Coordinates)obj;
// ReSharper disable twice CompareOfFloatsByEqualityOperator static values
return convObj.latitude == this.latitude && convObj.longitude == this.longitude;
return convObj.latitude.Equals(this.latitude) && convObj.longitude.Equals(longitude);
}
public static ulong GetRegionHashCode(float latitude, float longitude)