I print two tuples in the Xcode playground. But I get a strange result, see the following code snippet and the print result:
Code Snippet:
let x : (Double,Double) = (1.2,1.3)
print(x)
let y : (Double,Double) = (1.2,3.1)
print(y)
Print Result:
(1.2, 1.3)
(1.2, 3.1000000000000001)
Why it prints the 3.1000000000000001
which is NOT the actual value (3.1) I set for the tuple?
In the meantime, the 1.3
is printed out correctly.
My Swift compiler version info:
Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9