Friday, 15 March 2013

ios - Decimal values in tuple give garbage values in Swift -



ios - Decimal values in tuple give garbage values in Swift -

this question has reply here:

swift tuple has unexpected print result 1 reply

decimal values in tuple give garbage value

let qwerty = ("rachit", 5.55) println(qwerty)

it give output (rachit, 1.28416751252943e-313)

while

println(qwerty.1)

it give output 5.55

why?

its bug . can refer this link

mainly don't utilize whole tuple used.we used values using .0/.1 or using somename like

allow http200status = (statuscode: 200, description: "ok") println("the status code \(http200status.statuscode)") // prints "the status code 200" println("the status message \(http200status.description)") // prints "the status message ok”

ios tuples swift

No comments:

Post a Comment