• 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: NSNumber stringValue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSNumber stringValue


  • Subject: Re: NSNumber stringValue
  • From: Andrew Farmer <email@hidden>
  • Date: Fri, 11 Dec 2009 21:55:27 -0800

On 11 Dec 2009, at 21:14, Bryan Henry wrote:
> You should not compare floating point numbers for equality in most cases. This is true of any language on any platform.

Indeed, some floating-point numbers (such as the one represented by the integer 0x7fc00000) will compare as not equal to themselves:

{
    union { float f; long i; } u;
    u.i = 0x7fc00000;
    if(u.f == u.f)
        printf("As expected.\n");
    else
        printf("How strange.\n");
}_______________________________________________

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: NSNumber stringValue
      • From: Ben Haller <email@hidden>
References: 
 >NSNumber stringValue (From: RedleX Support <email@hidden>)
 >Re: NSNumber stringValue (From: Bryan Henry <email@hidden>)

  • Prev by Date: Re: [COCOA] notification of enter/focus event?
  • Next by Date: Re: NSURL Name of a File: Content nor Attribute, how to check for modification?
  • Previous by thread: Re: NSNumber stringValue
  • Next by thread: Re: NSNumber stringValue
  • Index(es):
    • Date
    • Thread