I have an CGFloat property and sometimes I get a return value of type Float64 or also of type Float32. Could I store both safely to CGFloat?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From the headers:
So
CGFloatandFloat32are bothfloats whileFloat64is adoubleso you would lose precision.(Edit to clarify: this is for 32 bit systems such as the iPhone. If you are building for 64 bit,
CGFloatis defined as adouble.)