• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: why use pow(x, 2)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why use pow(x, 2)?


  • Subject: Re: why use pow(x, 2)?
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 2 Nov 2009 11:04:09 -0800

On Mon, Nov 2, 2009 at 11:01 AM, Chunk 1978 <email@hidden> wrote:
> float dist = pow(red - r, 2) + pow(green - g, 2) + pow(blue - b, 2);
>
> float dist = ((red - r) *  2) + ((green - g) * 2) + ((blue - b) * 2);

You are aware that x^2 != 2x, right?

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >why use pow(x, 2)? (From: Chunk 1978 <email@hidden>)

  • Prev by Date: why use pow(x, 2)?
  • Next by Date: Re: why use pow(x, 2)?
  • Previous by thread: why use pow(x, 2)?
  • Next by thread: Re: why use pow(x, 2)?
  • Index(es):
    • Date
    • Thread