• 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: Best way to compare CGFloats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to compare CGFloats


  • Subject: Re: Best way to compare CGFloats
  • From: Alastair Houghton <email@hidden>
  • Date: Wed, 30 Jun 2010 11:06:55 +0100

On 30 Jun 2010, at 10:46, Rimas M. wrote:

> In my case I am interested in x's and y's comparison. Not points as
> themselves. But your suggestion gave me another question, which I have
> never thought about before - how NSEqualPoints, ...Rects etc works? I
> guess they *must* be safe to use, because NSPoint, NSRect etc relies
> on floats/doubles. Or they uses the same '==' and are TRUE only if
> points/rects are *really* equal?

I think they test for exact equality.  Whether that's documented or not I'm
not certain, but disassembling those functions appears to support that
conclusion.

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

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

  • Follow-Ups:
    • Re: Best way to compare CGFloats
      • From: "Rimas M." <email@hidden>
References: 
 >Best way to compare CGFloats (From: "Rimas M." <email@hidden>)
 >Re: Best way to compare CGFloats (From: Alastair Houghton <email@hidden>)
 >Re: Best way to compare CGFloats (From: "Rimas M." <email@hidden>)

  • Prev by Date: Re: Best way to compare CGFloats
  • Next by Date: Re: NSImage drawing on 10.5 issue
  • Previous by thread: Re: Best way to compare CGFloats
  • Next by thread: Re: Best way to compare CGFloats
  • Index(es):
    • Date
    • Thread