“f” after number

后端 未结 10 752
醉酒成梦
醉酒成梦 2020-11-27 11:02

What does the f after the numbers indicate? Is this from C or Objective-C? Is there any difference in not adding this to a constant number?

CGRec         


        
10条回答
  •  [愿得一人]
    2020-11-27 12:00

    From C. It means float literal constant. You can omit both "f" and ".0" and use ints in your example because of implicit conversion of ints to floats.

提交回复
热议问题