Skip to content

Commit 70b2f35

Browse files
committed
Don't compare floats without epsilon
1 parent 5ed8197 commit 70b2f35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/globeCoordinate/globeCoordinate.GlobeCoordinate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ globeCoordinate.GlobeCoordinate = ( function( globeCoordinate ) {
145145
var gc1Iso6709 = globeCoordinate.iso6709( this.getDecimal() ),
146146
gc2Iso6709 = globeCoordinate.iso6709( otherGlobeCoordinate.getDecimal() );
147147

148-
return this.getPrecision() === otherGlobeCoordinate.getPrecision()
148+
return Math.abs( this.getPrecision() - otherGlobeCoordinate.getPrecision() ) < 0.0000001
149149
&& gc1Iso6709 === gc2Iso6709;
150150
}
151151

0 commit comments

Comments
 (0)