我试图比较两个相同的纬度,它是类型的Double,当我打印结果时,它被评估为false.
print("spot latitude: " + String(spot.location.latitude))
print("first object: " + String(firstSpot.location.latitude))
print(spot.location.latitude == firstSpot.location.latitude)
Run Code Online (Sandbox Code Playgroud)
输出:
spot latitude: 32.8842183049047
first object: 32.8842183049047
false
Run Code Online (Sandbox Code Playgroud)
任何人都知道发生了什么?