这样会报错的在swift3.0里面,怎么解决?
func toBinary( num:Int)->String{
var num = num
var res = ""
repeat{
res = String(num%2) + res
num /= 2.0
}while num != 0 {
return res
}
}
func toBinary( num:Int)->String{
var num = num
var res = ""
repeat{
res = String(num%2) + res
num /= 2.0
}while num != 0 {
return res
}
}
2017-01-04
举报