Chiming in late-ish... On Apr 11, 2009, at 12:26 PM, James Maxwell wrote:
oooh, damn... I was afraid someone was going to say that. I just hoped there might be some way to force a float to conform to what NSLog %f prints... That seems like it might be a useful function - something like pround(aFloat), for "print-round", to force any float number to round as the printf %f would round it. Anyway, that's obviously not available.
It's not available because it's not possible. The print-formatting functions are rounding in decimal but floats are represented in binary. There are many values that seem simple to express in decimal but which are impossible to represent precisely in finite-precision binary.
Regards, Ken _______________________________________________ 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