On Tue, Oct 5, 2010 at 8:16 AM, Shawn Bakhtiar <shashan...@hotmail.com> wrote: > > > Eh? > > Did you just call typecasting "*completely* unnecessary and pointless"...
No, he called the specific casting you were performing unnecessary and pointless, which it is. The arithmetic conversion rules say that the integer literals will be promoted to the appropriate floating point type. So this is perfectly fine and does exactly what you expect: int main(int argc, char **argv) { float x = 2.5; x += 5; printf("%f\n", x); // prints "7.500000" return 0; } --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com