Unfortunately, what you see in the console is not what your real value is.

import UIKit var x = CGPoint(x:175.0,y:70.0) var y = CGPoint(x:175.0,y:70.00000000000001) print("\(x.equalTo(y)), \(x == y),\(x),\(y)")

The problem is, the console only allows for 10-16 but in reality your CGFloat can go even lower than that because on 64bit architecture, CGFloat is Double .

This means you have to cast your CGPoint values to a Float if you want to get equality that will appear on the console, so you need to do something like:

if Float(boxA.x) == Float(boxB.x) && Float(boxA.y) == Float(boxB.y) { //We have equality }

Now I like to take it one step further.

In most cases, we are using CGPoint to determine points on the scene. Rarely do we ever want to be dealing with 1/2 points, they make our lives just confusing.

So instead of Float , I like to cast to Int . This will guarantee if two points are lying on the same CGPoint in scene space