Swift: how to compare the first n digits past the decimal place for CGFloat?
The same as you would compare floating point numbers in any other language.
Take the absolute value of the difference of the numbers and compare it against your acceptable delta.
let delta: CGFloat = 0.00001
let a: CGFloat = 3.141592
let b: CGFloat = 3.141593
if abs(a-b) < delta {
println("close enough for government work")
}