In Objective-C (or C), if I do
CGFloat distance = 215;
CGFloat velocity = 20;
NSTimeInterval time = distance / velocity;
is that correct? Or, should I cast either distance
or velocity
to NSTimeInterval
?
Note, in iOS 7.0:
#if defined(__LP64__) && __LP64__
# define CGFLOAT_TYPE double
#else
# define CGFLOAT_TYPE float
#endif
typedef CGFLOAT_TYPE CGFloat;
typedef double NSTimeInterval;