• 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: Bug or feature?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug or feature?


  • Subject: Re: Bug or feature?
  • From: "M. Carlson" <email@hidden>
  • Date: Tue, 14 Feb 2006 18:14:27 +0000

This is using Xcode 2.2, OSX 10.4.4, PM G5 2GHz x 2. When I run this, I get random numbers in fval. This came about when I was retrieving a value from an NSDictionary, but there was no entry in the dictionary for the key I was using. I ended up getting wild values for fval, and finally boiled it down to this little snippet, which seems odd to me.

So, am I misunderstanding something about Cocoa, or is it some Xcode setting I'm supposed to be using so I get 0 back?

--M


From: Daniel Jalkut <email@hidden> To: M. Carlson <email@hidden> CC: email@hidden Subject: Re: Bug or feature? Date: Tue, 14 Feb 2006 13:06:13 -0500

By my understanding it should have value of 0,

What are you expecting to see. What do you see. What version of Xcode are you running. What platform is this running on, etc.

Open-ended questions are difficult to respond to.

Daniel

On Feb 14, 2006, at 12:57 PM, M. Carlson wrote:

What number should variable 'fval' have after this is executed?

- (void) doit
{
   float fval=0.0;
   NSNumber *aNumber=nil;
   fval=[aNumber floatValue];
   NSLog(@"fval is %f",fval);
}


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • floatValue of nil NSNumber unreliable (was Re: Bug or feature?)
      • From: Daniel Jalkut <email@hidden>
References: 
 >Re: Bug or feature? (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: Re: Bug or feature?
  • Next by Date: Re: Bug or feature?
  • Previous by thread: Re: Bug or feature?
  • Next by thread: floatValue of nil NSNumber unreliable (was Re: Bug or feature?)
  • Index(es):
    • Date
    • Thread