On Mon, Nov 2, 2009 at 2:25 PM, Ed Wynne <ar...@phasic.com> wrote: > > That said, the original question is a good one. Using x*x instead of > pow(x,2) would be quite a bit faster
Are you certain of that? With loop unrolling and inlined functions, it should result in identical code being produced by the compiler. > so except for clarity reasons, there isn't a > good reason to use pow() in that case. Clarity should be the default, not the exception. Unless you've profiled your code and found the use of pow() to be a significant bottleneck, there's no good reason *not* to use it. sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net _______________________________________________ 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